/* 
---------------------------------------------
Accessible Premium Authentication Styling
---------------------------------------------
*/

body {
    background-color: #F8FAFC;
    font-family: var(--secondary-font), sans-serif;
    color: var(--primary-text);
}

.auth-wrapper {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.75) 0%, rgba(226, 232, 240, 0.75) 100%), 
                url('/static/assets/adaptive_learning_bg1.jpg') no-repeat center center;
    background-size: cover;
    padding: 1.5rem;
}

/* Auth Card matching the mockups */
.auth-card {
    width: 100%;
    max-width: 650px;
    border-radius: 2rem;
    border: none;
    background-color: var(--primary-white);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Sliding Toggle Capsule container */
.toggle-container {
    background-color: #E2E8F0; /* Soft gray background container */
    border-radius: 2rem;
    padding: 6px;
    width: 250px;
    height: 52px;
    border: none !important;
}

/* Toggle Switch Action buttons */
.toggle-btn {
    background: transparent;
    border: none;
    height: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569; /* Slate gray for unselected text */
    border-radius: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    outline: none;
}

.toggle-btn.active {
    color: var(--primary-text); /* Black bold text when active */
}

/* The Sliding Capsule Background Element */
.toggle-slider {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(50% - 6px);
    background-color: var(--primary-white); /* White pill background */
    border-radius: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Update slider position based on state classes */
.state-signup .toggle-slider {
    transform: translateX(0%);
}

.state-signin .toggle-slider {
    transform: translateX(100%);
}

/* Form Swapping Fade In Animation */
@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-view-section {
    animation: formFadeIn 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.auth-title {
    font-family: var(--primary-font);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary-text);
    letter-spacing: -0.025em;
}

/* Form input fields styling matching mockups */
.auth-input {
    background-color: var(--primary-white) !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 1.25rem !important;
    height: 56px;
    padding: 0 1.25rem;
    font-family: var(--secondary-font);
    font-size: 0.95rem;
    color: var(--primary-text);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-input::placeholder {
    color: #94A3B8;
    opacity: 1;
}

.auth-input:focus {
    border-color: #6E86D0 !important;
    box-shadow: 0 0 0 4px rgba(110, 134, 208, 0.15) !important;
    outline: none !important;
}

/* Warning / Invalid Input Box Highlight */
.auth-input.is-invalid {
    border: 1.5px solid #EF4444 !important;
    background-color: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.auth-input.is-invalid:focus,
.auth-input.is-invalid:focus-visible {
    border-color: #DC2626 !important;
    outline: 2px solid #DC2626 !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25) !important;
}

.field-error-text {
    color: #DC2626;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.35rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    animation: fieldErrorFadeIn 0.2s ease-in-out;
}

@keyframes fieldErrorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.auth-input-shake {
    animation: inputShake 0.35s ease-in-out;
}

/* Custom styled dropdown menu selects */
select.auth-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1.25rem center !important;
    background-size: 16px 12px !important;
    color: #94A3B8 !important; /* Placeholder style gray color */
}

/* Dropdown color shifts when user chooses an option */
select.auth-input:not([value=""]):focus,
select.auth-input:valid {
    color: var(--primary-text) !important;
}

/* Date Picker styling details */
input[type="date"].auth-input {
    color: #94A3B8;
}

input[type="date"].auth-input:valid {
    color: var(--primary-text);
}

/* Accessibility Focus States (WCAG AAA Standards) */
.auth-input:focus,
.auth-input:focus-visible,
.toggle-btn:focus,
.toggle-btn:focus-visible,
.btn-auth-primary:focus,
.btn-auth-primary:focus-visible,
.btn-auth-outline:focus,
.btn-auth-outline:focus-visible {
    outline: 3px solid #6E86D0 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(110, 134, 208, 0.3) !important;
}

/* Action primary button (Sign Up / Sign In) */
.btn-auth-primary {
    background-color: #6E86D0 !important; /* Beautiful Slate Blue */
    color: var(--primary-white) !important;
    border-radius: 1.25rem !important;
    height: 56px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 12px rgba(110, 134, 208, 0.15);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-auth-primary:hover {
    background-color: #5671C9 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(86, 113, 201, 0.25);
}

.btn-auth-primary:active {
    transform: translateY(1px);
}

/* Secondary outline button (Google Auth) */
.btn-auth-outline {
    background-color: var(--primary-white) !important;
    color: var(--primary-text) !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 1.25rem !important;
    height: 56px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-auth-outline:hover {
    background-color: #F8FAFC !important;
    border-color: #CBD5E1 !important;
    transform: translateY(-1px);
}

.btn-auth-outline:active {
    transform: translateY(1px);
}

/* Middle Line Divider for Other Options separation */
.divider-line {
    height: 1.5px;
    background-color: #E2E8F0;
}

.divider-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748B;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Responsive adjustements */
@media (max-width: 576px) {
    .auth-card {
        padding: 2.5rem 1.5rem !important;
    }
}

/* Clickable Disability Option Cards */
.disability-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.disability-option-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: #F8FAFC;
    border: 2px dashed #CBD5E1;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    text-align: left;
    user-select: none;
    border-color: #CBD5E1 !important; /* Force dashed gray color initially */
}
.disability-option-card:hover {
    border-color: #6E86D0 !important;
    background-color: #F1F5F9;
    transform: translateY(-2px);
}
.disability-option-card:focus,
.disability-option-card:focus-visible {
    border-color: #6E86D0 !important;
    background-color: #F1F5F9;
    transform: translateY(-2px);
    outline: 3px solid #6E86D0 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(110, 134, 208, 0.25) !important;
}
.disability-option-card.selected {
    border: 3px solid #000000 !important;
    background-color: rgba(110, 134, 208, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.disability-option-card .card-icon {
    font-size: 1.75rem;
    color: #6E86D0;
    margin-right: 1.25rem;
    flex-shrink: 0;
}
.disability-option-card .card-title {
    font-weight: 700;
    color: var(--primary-text);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.disability-option-card .card-desc {
    font-size: 0.8rem;
    color: #64748B;
    line-height: 1.25;
}

/* Wizard steps transition wrapper */
.wizard-step {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.wizard-step.d-none {
    display: none !important;
}

/* Password Toggle Input Wrapper and Button */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .auth-input {
    width: 100%;
    padding-right: 3.25rem !important;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0.4rem 0.5rem;
    color: #94A3B8;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
    z-index: 3;
}

.password-toggle-btn:hover {
    color: #475569;
    background-color: rgba(110, 134, 208, 0.08);
}

.password-toggle-btn:focus,
.password-toggle-btn:focus-visible {
    color: #6E86D0 !important;
    outline: 2px solid #6E86D0 !important;
    outline-offset: 2px !important;
    background-color: rgba(110, 134, 208, 0.12);
}

.password-toggle-btn:active {
    transform: translateY(-50%) scale(0.92);
}