@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Kanit", "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 400;
    background: #F3F0ED;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #5C534A;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
}

.container {
    width: 100%;
    max-width: 460px;
}

/* Steps */
.step {
    display: none;
}
.step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Card */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(92, 83, 74, 0.08);
}

.card-header {
    position: relative;
    text-align: center;
    margin-bottom: 32px;
}

.card-header h1 {
    font-size: 24px;
    color: #4A4039;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.1px;
}

.subtitle {
    color: #9B8E82;
    font-size: 15px;
    line-height: 1.6;
}

.lang-toggle {
    position: absolute;
    right: 0;
    top: -20px;
    border: 1.5px solid #DDD7D1;
    border-radius: 10px;
    background: #fff;
    color: #7A6E62;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 10px;
    cursor: pointer;
}

.lang-toggle .sep {
    opacity: 0.55;
    margin: 0 4px;
}

.lang-toggle span.active {
    color: #4A4039;
}

.phone-display {
    margin-top: 8px;
    font-weight: 600;
    color: #9B8E82;
    font-size: 16px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

#registerForm .form-group.compact-field {
    margin-bottom: 8px;
}

#registerForm .form-group.compact-field .error-text {
    min-height: 0;
    margin-top: 2px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4A4039;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #DDD7D1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    color: #5C534A;
    background: #fff;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="email"]:focus {
    border-color: #9B8E82;
    box-shadow: 0 0 0 3px rgba(155, 142, 130, 0.12);
}

.form-group input.error {
    border-color: #C0695C;
}

.error-text {
    display: block;
    color: #C0695C;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    padding: 10px 20px;
    border: 1.5px solid #DDD7D1;
    border-radius: 8px;
    flex: 1;
    justify-content: center;
    transition: all 0.3s;
    color: #6B6259;
}

.radio-label:has(input:checked) {
    border-color: #9B8E82;
    background: rgba(155, 142, 130, 0.06);
    color: #4A4039;
}

.radio-label input[type="radio"] {
    accent-color: #9B8E82;
    width: 16px;
    height: 16px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: 13px !important;
    line-height: 1.5;
    color: #8A8079 !important;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #9B8E82;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.pdpa-link {
    color: #877A6E;
    text-decoration: underline;
}

.pdpa-section {
    margin-top: 6px;
}

.pdpa-heading {
    margin-bottom: 10px !important;
}

.pdpa-notice {
    border: 1.5px solid #BFD3E8;
    border-left: 5px solid #2B6FAF;
    border-radius: 12px;
    background: #F7FAFE;
    color: #35516F;
    line-height: 1.85;
    font-size: 15px;
    padding: 16px 18px;
}

.consent-title {
    margin-bottom: 10px !important;
}

.consent-card {
    border: 1.5px solid #D7DFE7;
    border-radius: 12px;
    background: #FBFDFF;
    padding: 14px 14px 12px;
}

.consent-card + .consent-card {
    margin-top: 10px;
}

.consent-checkbox {
    gap: 10px;
    font-size: 15px !important;
    line-height: 1.7;
    color: #2E3C4A !important;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-primary {
    background: #9B8E82;
    color: #fff;
}

.btn-primary:hover {
    background: #877A6E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 142, 130, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: #9B8E82;
    border: 1.5px solid #9B8E82;
    margin-top: 12px;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(155, 142, 130, 0.06);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* OTP Inputs */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.otp-input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1.5px solid #DDD7D1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    color: #4A4039;
}

.otp-input:focus {
    border-color: #9B8E82;
    box-shadow: 0 0 0 3px rgba(155, 142, 130, 0.12);
}

.otp-input.error {
    border-color: #C0695C;
}

/* Timer */
.timer-group {
    text-align: center;
    margin: 16px 0 8px;
    font-size: 14px;
    color: #8A8079;
}

#countdown {
    font-weight: 700;
    color: #9B8E82;
}

/* Success */
.success-icon {
    width: 80px;
    height: 80px;
    background: #7A9A6D;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-detail {
    margin-top: 12px;
    color: #8A8079;
    font-size: 14px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.error { background: #C0695C; }
.toast.success { background: #7A9A6D; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Error Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 28, 23, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E3DBD4;
    box-shadow: 0 12px 36px rgba(60, 48, 39, 0.2);
    padding: 20px 18px 16px;
}

.modal-card h3 {
    font-size: 20px;
    color: #4A4039;
    margin-bottom: 8px;
}

.modal-message {
    font-size: 15px;
    color: #6B6259;
    line-height: 1.6;
    margin-bottom: 14px;
}

.modal-btn {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 28px 20px;
    }
    .otp-input {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }
    .card-header h1 {
        font-size: 20px;
    }
}

/* Shop / Menu selection */
.menu-panel {
    margin-top: 12px;
    padding: 12px 14px;
    background: #FAF8F5;
    border: 1px solid #DDD7D1;
    border-radius: 8px;
}
.menu-panel[hidden] { display: none; }
.menu-panel-hint {
    font-size: 0.9rem;
    color: #5C534A;
    margin-bottom: 8px;
}

/* Contact channel checkboxes inside exclusive-offers card */
.contact-channels {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #DDD7D1;
}
.contact-channels-label {
    font-size: 0.9rem;
    color: #5C534A;
    margin-bottom: 6px;
}
.contact-channel-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
