/* Full-screen auth overlay (app-style). Not Bootstrap modal. */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-box {
    width: 900px;
    max-width: 95%;
    background: #ffffff;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Left: institutional panel */
.auth-side {
    background: #0f172a;
    color: #fff;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.auth-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 24px;
    display: block;
}

.auth-brand {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-align: center;
}

.auth-desc {
    font-size: 15px;
    color: #ffffff;
    opacity: 0.9;
    line-height: 1.6;
    margin: 0;
    text-align: center;
    max-width: 280px;
}

/* Right: form */
.auth-form-wrapper {
    padding: 50px;
    position: relative;
}

.auth-close {
    position: absolute;
    right: 20px;
    top: 20px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

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

.auth-form .auth-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #1f2937;
}

.auth-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    display: none;
}

.auth-error.auth-error-visible {
    display: block;
}

.auth-user-types {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: #f9fafb;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
}

.auth-user-type {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    text-align: center;
    white-space: nowrap;
}

.auth-user-type:hover {
    background: #e5e7eb;
}

.auth-user-type-active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

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

.auth-form .form-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.auth-form .form-group input::placeholder {
    color: #9ca3af;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.password-wrapper input {
    flex: 1;
    border: none;
    border-radius: 0;
}

.password-wrapper input:focus {
    box-shadow: none;
}

.toggle-password {
    padding: 0 14px;
    border: none;
    border-left: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.toggle-password:hover {
    background: #f3f4f6;
    color: #374151;
}

.auth-form .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.form-option-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #374151;
}

.form-option-remember input {
    margin: 0;
}

.auth-forgot {
    color: #0f172a;
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
    background: #1e293b;
}

.auth-submit:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-submit .auth-submit-loading {
    display: none;
}

.auth-submit.loading .auth-submit-text {
    display: none;
}

.auth-submit.loading .auth-submit-loading {
    display: inline;
}

.auth-note {
    margin-top: 15px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.auth-signup {
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.auth-signup a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

.auth-signup a:hover {
    text-decoration: underline;
}

/* Responsive: single column, hide left panel */
@media (max-width: 768px) {
    .auth-box {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .auth-side {
        display: none;
    }

    .auth-form-wrapper {
        padding: 40px 24px 32px;
    }

    .auth-close {
        right: 16px;
        top: 16px;
    }
}

@media (max-width: 480px) {
    .auth-form-wrapper {
        padding: 32px 20px 24px;
    }

    .auth-form .auth-title {
        font-size: 20px;
    }
}
