:root {
    --bg-primary: #f8fafc;
    --bg-body-radial: radial-gradient(at 0% 0%, rgba(219, 234, 254, 0.4) 0px, transparent 50%),
                      radial-gradient(at 50% 0%, rgba(224, 242, 254, 0.4) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(243, 232, 255, 0.4) 0px, transparent 50%);
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    
    --accent-blue: #0062ff;
    --accent-blue-hover: #0052cc;
    
    --success-green: #166534;
    --success-green-bg: #dcfce7;
    --success-green-border: #bbf7d0;
    
    --error-red: #991b1b;
    --error-red-bg: #fee2e2;
    --error-red-border: #fca5a5;
    
    --warning-yellow: #854d0e;
    --warning-yellow-bg: #fef9c3;
    --warning-yellow-border: #fef08a;
    
    --font-outfit: 'Outfit', sans-serif;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --btn-shadow: 0 4px 12px rgba(0, 98, 255, 0.15);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-primary);
    background-image: var(--bg-body-radial);
    font-family: var(--font-outfit);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Hide background blooms from neon style */
.bg-gradient {
    display: none !important;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1250px; /* Expanded card width to allow 800px right column on PC */
    padding: 20px;
    z-index: 10;
    transition: max-width 0.3s ease;
}

/* Card */
.glass-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -6px rgba(0, 0, 0, 0.07);
}

/* Language Selector */
.lang-selector {
    position: absolute;
    top: 25px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-family: var(--font-outfit);
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 5px 12px;
    border-radius: 6px;
}

.lang-btn span {
    display: inline-block;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.lang-btn.active span {
    color: var(--accent-blue) !important;
    font-weight: 700;
}

.lang-divider {
    display: none !important; /* Visual tab blocks don't need pipe dividers */
}

/* Header */
.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, var(--accent-blue));
    border-radius: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 98, 255, 0.2);
}

.logo-wrapper i {
    color: #ffffff;
}

.pulse-icon {
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.card-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin-bottom: 25px;
}

/* Form Styles */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.input-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group label i {
    color: var(--accent-blue);
}

.input-group input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 16px;
    color: #0f172a;
    font-family: var(--font-outfit);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.15);
}

/* Loader Styles */
.loader-wrapper {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    padding: 20px 0;
}

.loader-wrapper p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.custom-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 98, 255, 0.15);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results section */
.result-section {
    display: none;
    text-align: center;
    margin-bottom: 15px;
    animation: slideUp 0.35s ease-out forwards;
}

/* Grid layout for split-columns on PC */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 800px; /* Left column auto-scales, Right column is exactly 800px wide */
    gap: 24px;
    align-items: start;
    text-align: left;
    margin-bottom: 25px;
}

.column-left, .column-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Responsive column stack on medium/small devices */
@media (max-width: 991px) {
    .result-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
    background: var(--success-green-bg);
    color: var(--success-green);
    border: 1px solid var(--success-green-border);
}

.status-badge .dot {
    width: 7px;
    height: 7px;
    background-color: var(--success-green);
    border-radius: 50%;
    display: inline-block;
}

/* Info Box */
.order-info-box {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row .label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 25px;
}

.info-row .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
    line-height: 1.5;
    flex-grow: 1;
}

.info-row .value.option-highlight {
    color: #cc0066;
    font-weight: 700;
}

/* Delivery Box */
.delivery-container {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    width: 100%;
}

.delivery-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

/* Content Container (Link or Account Text) */
.content-wrapper-box {
    position: relative;
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px 20px;
    min-height: 52px;
    display: flex;
    align-items: center;
}

.content-box {
    font-family: monospace;
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: text;
    line-height: 1.5;
}

.btn-copy {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-outfit);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-copy:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Manual Processing Notice */
.notice-box {
    display: flex;
    gap: 10px;
    background: var(--warning-yellow-bg);
    border: 1px solid var(--warning-yellow-border);
    padding: 14px 16px;
    border-radius: 10px;
    color: var(--warning-yellow);
    font-size: 12.5px;
    line-height: 1.6;
    align-items: flex-start;
}

.notice-box i {
    font-size: 15px;
    margin-top: 2px;
}

/* Link Button Container */
.link-btn-wrapper {
    margin-top: 15px;
    width: 100%;
}

/* Action button */
.btn-action {
    width: 100%;
    justify-content: center;
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: var(--btn-shadow);
    border: none;
}

.btn-action:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 98, 255, 0.3);
}

/* Integrated Instruction Box */
.instruction-box {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--accent-blue);
    border-radius: 12px;
    padding: 18px 22px;
}

.instruction-header {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-header i {
    color: var(--accent-blue);
}

.instruction-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: var(--font-outfit);
    word-break: break-word;
    word-wrap: break-word;
}

/* Common buttons */
.btn {
    font-family: var(--font-outfit);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 6px 16px rgba(0, 98, 255, 0.3);
    transform: translateY(-1px);
}

.btn-back {
    width: 100%;
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
}

.btn-back:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-color: #94a3b8;
}

/* Error banner */
.error-wrapper {
    display: none;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

.error-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--error-red-bg);
    border: 1px solid var(--error-red-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--error-red);
    font-size: 12.5px;
    text-align: left;
}

.error-box i {
    font-size: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Footer */
.card-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

/* Voucher Reward Box */
.voucher-box {
    margin-top: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    margin-bottom: 20px;
}

.voucher-icon-wrapper {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #ffffff;
    flex-shrink: 0;
}

.voucher-content h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.voucher-content p {
    font-size: 12.5px;
    color: #1e40af;
    line-height: 1.5;
}

/* Mobile Responsive Optimization - Edge to Edge */
@media (max-width: 576px) {
    body {
        align-items: flex-start;
        padding: 0;
        margin: 0;
    }
    .container {
        padding: 0 !important;
        margin: 0;
        width: 100% !important;
        max-width: 100% !important;
    }
    .glass-card {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: none !important;
        padding: 30px 0 !important;
        width: 100% !important;
        min-height: 100vh;
        box-shadow: none !important;
        background: #ffffff !important;
    }
    
    /* Apply horizontal padding to non-full-bleed card children */
    .card-header,
    .form-section,
    .status-badge,
    .error-wrapper,
    .card-footer {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .card-header h1 {
        font-size: 28px !important;
    }

    /* Make order info box and delivery container go full-bleed (edge-to-edge) */
    .order-info-box {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 20px 16px !important;
    }

    .delivery-container {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 20px 16px !important;
    }

    .voucher-box {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 16px 16px !important;
        border-top: 1px solid #bfdbfe !important;
        border-bottom: 1px solid #bfdbfe !important;
    }

    /* Back button positioning */
    .btn-back {
        margin-left: 16px !important;
        margin-right: 16px !important;
        width: calc(100% - 32px) !important;
    }

    .instruction-box {
        margin-left: 16px !important;
        margin-right: 16px !important;
        border-radius: 12px !important;
    }
    
    .input-group input {
        padding: 14px 16px !important;
    }
    .btn {
        padding: 14px 20px !important;
    }
    
    .back-to-home {
        position: static !important;
        margin-bottom: 20px !important;
        display: inline-flex !important;
        margin-left: 16px !important;
    }
    .converter-textarea {
        height: 220px !important;
    }
    .control-panel {
        padding: 16px !important;
        gap: 15px !important;
    }
    .converter-grid {
        gap: 15px !important;
    }
}
