/* ============================================
   AUTH PAGES - Login & Register
   ============================================ */

/* ---- Page Background ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, var(--color-primary-light) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* ---- Animated Background Shapes ---- */
.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

.auth-page::before {
    width: 500px;
    height: 500px;
    background: var(--color-secondary);
    top: -150px;
    right: -100px;
    animation: floatShape 12s ease-in-out infinite;
}

.auth-page::after {
    width: 400px;
    height: 400px;
    background: var(--color-secondary-light);
    bottom: -100px;
    left: -80px;
    animation: floatShape 15s ease-in-out infinite reverse;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
}

/* ---- Card Container ---- */
.auth-shell {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Logo Section ---- */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(45, 178, 232, 0.3);
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        box-shadow: 0 8px 24px rgba(45, 178, 232, 0.2);
    }

    to {
        box-shadow: 0 8px 32px rgba(45, 178, 232, 0.45);
    }
}

.auth-logo-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.auth-title {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* ---- Form ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ---- Form Groups ---- */
.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.3px;
}

/* ---- Input Wrapper ---- */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    transition: color var(--transition-base);
    pointer-events: none;
}

.auth-input-wrapper .input-icon svg {
    width: 18px;
    height: 18px;
}

.auth-input {
    width: 100%;
    padding: 0.8rem 0.9rem 0.8rem 2.8rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--color-text-main);
    background: var(--color-surface);
    transition: all var(--transition-base);
    outline: none;
}

.auth-input::placeholder {
    color: var(--color-text-muted);
}

.auth-input:hover {
    border-color: var(--color-secondary-light);
}

.auth-input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(45, 178, 232, 0.15);
    transform: translateY(-1px);
}

.auth-input:focus~.input-icon,
.auth-input:focus+.input-icon,
.auth-input-wrapper:focus-within .input-icon {
    color: var(--color-secondary);
}

/* ---- Input Error State ---- */
.auth-input-error {
    border-color: var(--color-danger) !important;
    background: var(--color-danger-light);
}

.auth-input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.auth-error-text {
    font-size: 0.8rem;
    color: var(--color-danger);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.auth-error-text::before {
    content: '⚠';
    font-size: 0.75rem;
}

/* ---- Password Toggle ---- */
.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition-base);
}

.password-toggle:hover {
    color: var(--color-secondary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ---- Remember Me ---- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.auth-remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.auth-remember input[type="checkbox"]:checked {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.auth-remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-forgot-link {
    font-size: 0.85rem;
    color: var(--color-secondary);
    font-weight: 600;
    transition: color var(--transition-base);
}

.auth-forgot-link:hover {
    color: var(--color-secondary-dark);
    text-decoration: underline;
}

/* ---- Submit Button ---- */
.auth-button {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-brand);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.auth-button:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    box-shadow: 0 8px 25px rgba(17, 67, 104, 0.4);
    transform: translateY(-2px);
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(17, 67, 104, 0.3);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ---- Footer Link ---- */
.auth-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.auth-footer a {
    color: var(--color-secondary);
    font-weight: 700;
    transition: color var(--transition-base);
}

.auth-footer a:hover {
    color: var(--color-secondary-dark);
    text-decoration: underline;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-divider span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Alert Messages ---- */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-success {
    background: var(--color-success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert-danger {
    background: var(--color-danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ---- Bottom Branding ---- */
.auth-branding {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.auth-branding span {
    color: var(--color-secondary-light);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .auth-logo-icon {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }

    .auth-logo-icon svg {
        width: 30px;
        height: 30px;
    }
}

/* ---- Password Strength Indicator ---- */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength-text {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

/* ---- Button Spinner ---- */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ---- Logout Button (Home) ---- */
.btn-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-base);
    margin-left: 0.5rem;
}

.btn-logout:hover {
    color: #ef4444;
}

/* ---- Dashboard Description ---- */
.dashboard-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.dashboard-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--color-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 200px;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-secondary);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s;
}

.dashboard-card:hover .dashboard-icon {
    transform: scale(1.15);
}

.dashboard-title {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 0;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .auth-page::before,
    .auth-page::after {
        animation: none;
    }

    .auth-logo-icon {
        animation: none;
    }

    .auth-button::before {
        display: none;
    }

    .auth-button:hover {
        transform: none;
    }
}