/* ============================================================
   DOAI WhatsApp Login — Frontend Styles
   ============================================================ */

.doai-wa-login-box {
    max-width: 440px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
    padding: 40px 36px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.doai-wa-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.doai-wa-icon {
    width: 64px;
    height: 64px;
    background: #e8f8ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.doai-wa-login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.doai-wa-login-header p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Field */
.doai-wa-field {
    margin-bottom: 24px;
}

.doai-wa-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 8px;
}

.doai-wa-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.doai-wa-input-wrap:focus-within {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.doai-wa-prefix {
    padding: 0 14px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    border-right: 2px solid #e5e7eb;
    height: 48px;
    line-height: 48px;
    white-space: nowrap;
}

.doai-wa-input-wrap input[type="tel"] {
    flex: 1;
    height: 48px;
    border: none;
    outline: none;
    padding: 0 16px;
    font-size: 1rem;
    color: #111827;
    background: transparent;
    -webkit-appearance: none;
}

.doai-wa-field small {
    display: block;
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Button */
.doai-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.doai-wa-btn-primary {
    width: 100%;
    background: #25D366;
    color: #fff;
}

.doai-wa-btn-primary:hover:not(:disabled) {
    background: #1ebe5d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.doai-wa-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.doai-wa-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.doai-wa-btn-secondary:hover {
    background: #e5e7eb;
}

/* Spinner animation */
@keyframes doai-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.doai-wa-btn-loading svg {
    animation: doai-spin 0.8s linear infinite;
}

/* Notice */
.doai-wa-notice {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.doai-wa-notice-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.doai-wa-notice-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.doai-wa-notice-info {
    margin-top: 0;
    margin-bottom: 18px;
    background: #eff5fc;
    color: #2c4f86;
    border: 1px solid #cfe0f4;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.doai-wa-otp-note {
    margin: 6px 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: #2c4f86;
}

/* Footer */
.doai-wa-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.doai-wa-footer p {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0;
}

.doai-wa-footer a {
    color: #25D366;
    font-weight: 600;
    text-decoration: none;
}
.doai-wa-footer a:hover {
    text-decoration: underline;
}

/* Already logged in state */
.doai-wa-already-in {
    text-align: center;
}

.doai-wa-already-in p {
    color: #374151;
    margin-bottom: 20px;
}

/* Mobile */
@media (max-width: 480px) {
    .doai-wa-login-box {
        margin: 20px 16px;
        padding: 28px 20px;
    }
}

/* ============================================================
   Registration Form Extensions
   ============================================================ */

.doai-wa-register-box {
    max-width: 600px;
}

.doai-wa-register-header {
    text-align: center;
    margin-bottom: 28px;
}

.doai-wa-register-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.doai-wa-register-header p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Sections */
.doai-wa-section {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px 20px 8px;
    margin-bottom: 20px;
}

.doai-wa-section-optional {
    background: #f9f9ff;
    border-color: #e8e8f8;
}

.doai-wa-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doai-optional-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background: #e8e8f8;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Two-column row */
.doai-wa-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 520px) {
    .doai-wa-row { grid-template-columns: 1fr; }
}

/* Field */
.doai-wa-field {
    margin-bottom: 16px;
}

.doai-wa-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.doai-req {
    color: #ef4444;
    margin-left: 2px;
}

.doai-wa-field input[type="text"],
.doai-wa-field input[type="email"],
.doai-wa-field input[type="number"] {
    width: 100%;
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.doai-wa-field input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

/* Dropdown (Peran Anda) — styled to match the inputs */
.doai-wa-field select {
    width: 100%;
    height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 40px 0 14px;
    font-size: 0.95rem;
    color: #111827;
    background-color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.2s;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%236b7280%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.doai-wa-field select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

/* Field error state */
.doai-field-has-error input,
.doai-field-has-error .doai-wa-input-wrap {
    border-color: #ef4444 !important;
}

.doai-field-error {
    display: none;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Checkbox grid for Tingkatan Kelas */
.doai-wa-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.doai-wa-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.15s;
    user-select: none;
}

.doai-wa-checkbox-item:hover {
    border-color: #25D366;
    background: #f0fdf4;
}

.doai-wa-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #25D366;
    cursor: pointer;
}

.doai-wa-checkbox-item:has(input:checked) {
    border-color: #25D366;
    background: #f0fdf4;
    color: #15803d;
}

/* Form footer */
.doai-wa-form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.doai-wa-form-footer p {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0;
}

.doai-wa-form-footer a {
    color: #25D366;
    font-weight: 600;
    text-decoration: none;
}

.doai-wa-form-footer a:hover {
    text-decoration: underline;
}

/* Register box submit button */
.doai-wa-register-box .doai-wa-btn-primary {
    margin-top: 8px;
}

/* ============================================================
   Register card chrome (was previously unstyled) + Brand header
   ============================================================ */

/* Give the register box the same white-card treatment as the login box */
.doai-wa-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
    padding: 40px 36px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Brand header (logo + tagline) — shown at the top of both forms */
.doai-wa-brand {
    text-align: center;
    margin-bottom: 24px;
}

.doai-wa-logo {
    display: block;
    width: 132px;
    height: auto;
    margin: 0 auto;
}

.doai-wa-logo-fallback {
    width: 132px;
    margin: 0 auto;
}

.doai-wa-logo-fallback svg {
    display: block;
    width: 100%;
    height: auto;
}

.doai-wa-tagline {
    display: block;
    margin-top: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
}

@media (max-width: 480px) {
    .doai-wa-box {
        margin: 20px 16px;
        padding: 28px 20px;
    }
}

/* OTP verification step */
.doai-wa-otp-input {
    text-align: center;
    letter-spacing: 0.4em;
    font-size: 1.4rem !important;
    font-weight: 700;
}
.doai-wa-resend {
    text-align: center;
    margin: 14px 0 0;
}
.doai-wa-resend a {
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: none;
}
.doai-wa-resend a:hover {
    color: #25D366;
}
