/* ============================================
   AUTH.CSS — SmartIntern Login & Signup
   Unified stylesheet for both auth pages
   Theme: Navy & White — Refined & Premium
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ============================================
   PAGE LAYOUT — Full-height centered scene
   ============================================ */

.login-container {
    min-height: calc(100vh - 80px); /* account for fixed navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    position: relative;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;

    /* Layered background mesh */
    background:
        radial-gradient(ellipse 65% 55% at 8%  15%,  rgba(30, 58, 138, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 92%  85%,  rgba(16, 185, 129, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 45% 45% at 55%  50%,  rgba(59, 130, 246, 0.04) 0%, transparent 70%),
        #f8faff;
}

/* Dot grid texture */
.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(30, 58, 138, 0.10) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Floating accent orbs */
.login-container::after {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    top: -100px;
    right: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 9s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(18px, 22px) scale(1.06); }
}

/* ============================================
   CARD
   ============================================ */

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 24px;
    padding: 2.75rem 2.5rem;

    /* Layered card shadow — depth without harshness */
    box-shadow:
        0 0 0 1px rgba(30, 58, 138, 0.07),
        0 4px 12px rgba(30, 58, 138, 0.06),
        0 16px 40px rgba(30, 58, 138, 0.10),
        0 40px 80px rgba(30, 58, 138, 0.06);

    animation: cardRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Subtle top accent line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 50%, #10b981 100%);
}

@keyframes cardRise {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ============================================
   CARD HEADER
   ============================================ */

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: cardRise 0.65s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-header h1 {
    font-family: 'Syne', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;

    background: linear-gradient(135deg, #0f2167 0%, #1e3a8a 40%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   FLASH ALERTS
   ============================================ */

.alert {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: alertShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.alert-danger::before {
    content: '⚠';
    font-size: 1rem;
    flex-shrink: 0;
}

/* ============================================
   FORM LABELS
   ============================================ */

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

/* ============================================
   INPUTS
   ============================================ */

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f8faff;
    transition:
        border-color 0.2s ease,
        box-shadow   0.2s ease,
        background   0.2s ease;
    outline: none;
    appearance: none;
}

.form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-control:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.12),
        0 2px 8px rgba(30, 58, 138, 0.08);
}

.form-control:focus::placeholder {
    color: #c8d6e5;
}

/* Valid state */
.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
    background: #f0fdf8;
}

/* Invalid state */
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10);
    background: #fff8f8;
}

.invalid-feedback {
    display: none;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 500;
}

.form-control.is-invalid ~ .invalid-feedback,
.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

/* ============================================
   PASSWORD WRAPPER & TOGGLE
   ============================================ */

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity   0.15s ease;
    opacity: 0.6;
}

.password-toggle:hover {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
}

/* ============================================
   FORM SPACING
   ============================================ */

.mb-3 {
    margin-bottom: 1.1rem;
    animation: cardRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mb-3:nth-child(1) { animation-delay: 0.12s; }
.mb-3:nth-child(2) { animation-delay: 0.18s; }
.mb-3:nth-child(3) { animation-delay: 0.24s; }

/* ============================================
   PRIMARY SUBMIT BUTTON
   ============================================ */

.btn-primary-login {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-align: center;

    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.30), 0 1px 4px rgba(30, 58, 138, 0.18);

    position: relative;
    overflow: hidden;
    transition:
        transform    0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow   0.25s ease;

    animation: cardRise 0.55s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Shimmer sweep on hover */
.btn-primary-login::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transition: left 0.5s ease;
}

.btn-primary-login:hover::before { left: 100%; }

.btn-primary-login:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 28px rgba(30, 58, 138, 0.38), 0 2px 8px rgba(30, 58, 138, 0.18);
}

.btn-primary-login:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.22);
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    animation: cardRise 0.55s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    border-radius: 2px;
}

.divider span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

/* ============================================
   SOCIAL LOGIN — Google Button
   ============================================ */

.social-login {
    animation: cardRise 0.55s 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.btn-google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow   0.2s ease,
        transform    0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background   0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-google-login img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.btn-google-login:hover {
    border-color: #3b82f6;
    background: #f8faff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.14), 0 1px 4px rgba(30, 58, 138, 0.06);
    transform: translateY(-2px);
    color: #1e3a8a;
    text-decoration: none;
}

.btn-google-login:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   REDIRECT LINK
   ============================================ */

.signup-redirect {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    animation: cardRise 0.55s 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.signup-redirect a {
    font-weight: 700;
    color: #1e3a8a;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

/* Underline sweep */
.signup-redirect a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.signup-redirect a:hover { color: #2563eb; }
.signup-redirect a:hover::after { width: 100%; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 575.98px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .login-header h1 {
        font-size: 1.6rem;
    }

    .btn-primary-login,
    .btn-google-login {
        padding: 0.85rem 1.25rem;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 1.75rem 1.25rem;
    }
}

/* ============================================
   FOCUS ACCESSIBILITY
   ============================================ */

.form-control:focus-visible,
.btn-primary-login:focus-visible,
.btn-google-login:focus-visible,
.signup-redirect a:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}