/* ============================================
   Auth Pages — Visual Polish
   ============================================ */

/* Subtle radial gradient background pattern */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 30%, rgba(91, 75, 138, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(91, 75, 138, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 110, 193, 0.02) 0%, transparent 60%),
        linear-gradient(135deg, #5B4B8A 0%, #7B6BA8 50%, #5B4B8A 100%);
}

/* Card entrance animation */
.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(91, 75, 138, 0.15), 0 2px 8px rgba(91, 75, 138, 0.08);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    animation: authCardEntrance 0.4s ease-out both;
}

@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-header {
    background: linear-gradient(135deg, #5B4B8A 0%, #7B6BA8 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.auth-card form {
    padding: 30px;
}

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

/* Input focus: bottom-border slide-in from center */
.auth-card .form-group {
    position: relative;
}

.auth-card .form-group input,
.auth-card .form-group select {
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-full {
    width: 100%;
}

/* Auth links with underline slide animation */
.auth-links {
    padding: 0 30px 30px;
    text-align: center;
}

.auth-links p {
    margin: 10px 0;
    color: #6B6280;
}

.auth-links a {
    color: #7B6BA8;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #7B6BA8;
    transition: width 0.3s ease;
}

.auth-links a:hover::after {
    width: 100%;
}

.auth-links a:hover {
    color: #5B4B8A;
}

/* Password requirements with smooth transitions */
.password-requirements {
    background: #F3F1F8;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.password-requirements p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #2D2640;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.password-requirements li {
    color: #9590A6;
    margin: 4px 0;
    transition: color 0.3s ease;
}

.password-requirements li.valid {
    color: #4CAF82;
    transition: color 0.3s ease;
}

.password-requirements li.valid::marker {
    content: "\2713  ";
}

/* Error message slide-down entrance */
.error-message {
    animation: errorSlideDown 0.3s ease-out both;
}

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

/* Dashboard navigation */
.nav-bar {
    background: #5B4B8A;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-bar .logo {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-bar .nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-bar .nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-bar .nav-links a:hover {
    color: white;
}

.nav-bar .user-info {
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-bar .user-info span {
    opacity: 0.9;
}

.nav-bar .btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-bar .btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Role badge */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.client {
    background: #e3f2fd;
    color: #1565c0;
}

.role-badge.attorney {
    background: #e8f5e9;
    color: #2e7d32;
}

.role-badge.admin {
    background: #fce4ec;
    color: #c2185b;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
        align-items: flex-start;
        padding-top: 50px;
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-header {
        padding: 25px 20px;
    }

    .auth-card form {
        padding: 25px 20px;
    }

    .auth-links {
        padding: 0 20px 25px;
    }

    .nav-bar {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-bar .logo {
        font-size: 1.1rem;
    }

    .nav-bar .nav-links {
        gap: 12px;
    }

    .nav-bar .user-info {
        gap: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
        padding-top: 30px;
    }

    .auth-header h1 {
        font-size: 1.3rem;
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    .auth-card form {
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .password-requirements {
        padding: 12px;
        font-size: 0.8rem;
    }

    .nav-bar {
        flex-direction: column;
        text-align: center;
    }

    .nav-bar .logo {
        margin-bottom: 5px;
    }

    .nav-bar .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .nav-bar .user-info {
        justify-content: center;
        width: 100%;
        margin-top: 5px;
    }

    .nav-bar .btn-logout {
        padding: 6px 14px;
    }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
    .auth-card .form-group input,
    .auth-card .form-group select {
        min-height: 48px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .btn-full {
        min-height: 48px;
    }

    .nav-bar .btn-logout {
        min-height: 40px;
        padding: 10px 18px;
    }

    .nav-bar .nav-links a {
        padding: 8px;
    }
}
