/* ==========================================================================
   AUTH MODAL STYLES (LOGIN & REGISTER)
   Brand Color: #0d54a4
   ========================================================================== */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
    font-family: var(--font-family, "Inter", "Roboto", -apple-system, BlinkMacSystemFont, sans-serif);
    -webkit-font-smoothing: antialiased;
}

.auth-modal.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Modal Backdrop */
.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Modal Box Container */
.auth-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    z-index: 2;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
}

.auth-modal.is-open .auth-modal-dialog {
    transform: scale(1) translateY(0);
}

/* Modal Close Button */
.auth-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
}

.auth-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.auth-modal-body {
    padding: 34px 34px 28px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.auth-modal-body::-webkit-scrollbar {
    width: 6px;
}

.auth-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Header inside Modal */
.auth-modal-head {
    margin-bottom: 22px;
}

.auth-modal-head h2 {
    font-size: 25px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.auth-modal-sub {
    font-size: 14.5px;
    color: #64748b;
    margin: 0;
}

.auth-modal-sub a.auth-switch-btn {
    color: #ea580c;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.auth-modal-sub a.auth-switch-btn:hover {
    color: #0d54a4;
    text-decoration: underline;
}

/* Panels switch */
.auth-panel {
    display: none;
    animation: authFadeIn 0.25s ease forwards;
}

.auth-panel.is-active {
    display: block;
}

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

/* Alerts inside form */
.auth-alert {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
    line-height: 1.45;
    align-items: center;
    gap: 8px;
}

.auth-alert.is-show {
    display: flex;
}

.auth-alert-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.auth-alert-success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #15803d;
}

/* Form Fields */
.auth-field {
    margin-bottom: 15px;
}

.auth-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.auth-req {
    color: #e11d48;
    margin-left: 3px;
    font-weight: bold;
}

.auth-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #fbfbfb;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input-wrap:focus-within {
    background: #ffffff;
    border-color: #0d54a4;
    box-shadow: 0 0 0 3.5px rgba(13, 84, 164, 0.12);
}

.auth-field.has-error .auth-input-wrap {
    border-color: #ef4444;
}

.auth-input-wrap input,
.auth-input-wrap select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
    border: none;
    outline: none;
    border-radius: 10px;
    box-sizing: border-box;
}

.auth-input-wrap select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
}

.auth-input-wrap select option {
    color: #0f172a;
    background: #ffffff;
}

.auth-input-wrap select option[value=""][disabled] {
    color: #9ca3af;
}

.auth-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.auth-input-wrap input::placeholder {
    color: #9ca3af;
    font-size: 13.5px;
}

/* Toggle eye button */
.auth-toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.auth-toggle-pwd:hover {
    color: #0f172a;
}

.auth-input-wrap:has(.auth-toggle-pwd) input {
    padding-right: 42px;
}

/* Field Hint / Validation message */
.auth-hint {
    font-size: 12px;
    margin-top: 4px;
    color: #ef4444;
    display: none;
}

.auth-hint.is-show {
    display: block;
}

/* 2 columns row in register */
.auth-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Actions Row (Login) */
.auth-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 20px;
    font-size: 13.5px;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: #334155;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #0d54a4;
    cursor: pointer;
    border-radius: 4px;
    margin: 0;
}

.auth-forgot-link {
    color: #ea580c;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: #0d54a4;
    text-decoration: underline;
}

/* Terms Checkbox in Register */
.auth-terms-box {
    margin: 14px 0 20px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #334155;
}

.auth-terms-box a {
    color: #ea580c;
    text-decoration: none;
    font-weight: 500;
}

.auth-terms-box a:hover {
    color: #0d54a4;
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: #0d54a4;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(13, 84, 164, 0.2);
}

.auth-submit-btn:hover:not(:disabled) {
    background: #0a4384;
    box-shadow: 0 6px 16px rgba(13, 84, 164, 0.3);
    transform: translateY(-1px);
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    background: #cbd5e1;
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    padding: 0 12px;
}

/* Google Social Button */
.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 18px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .auth-modal-dialog {
        max-width: 100%;
        border-radius: 18px;
    }

    .auth-modal-body {
        padding: 26px 18px 22px;
    }

    .auth-modal-head h2 {
        font-size: 22px;
    }

    .auth-row-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-actions-row {
        flex-wrap: wrap;
        gap: 10px;
    }
}
