/* Auth Pages Styles */

/* Reset for auth pages */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ── Entrance Keyframes (CSS fill-mode:both = no flicker) ─── */
@keyframes auth-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes auth-fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes auth-slideLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Micro-interaction Keyframes (validation, alerts) ─────── */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 40px;
    }
}

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

/* ── Auth Layout - Full Screen ───────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */
.auth-header {
    background: transparent;
    padding: 0.75rem 0;
    flex-shrink: 0;
    animation: auth-fadeIn 0.4s ease-out both;
}

.auth-header .navbar-brand {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-header .navbar-brand img {
    filter: brightness(0) invert(1);
}

.auth-header .nav-link {
    color: #fff !important;
    font-weight: 500;
    margin-left: 1.5rem;
    transition: color 0.2s ease;
}

.auth-header .nav-link:hover {
    color: var(--bs-primary) !important;
}

/* ── Main Content ────────────────────────────────────────── */
.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    overflow-y: auto;
    padding: 1rem 0;
}

/* ── Left Side - Hero Content (animated) ─────────────────── */
.auth-hero {
    color: #fff;
    padding: 2rem;
    animation: auth-slideLeft 0.5s ease-out 0.1s both;
}

.auth-hero .badge-text {
    color: var(--bs-primary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: inline-block;
    animation: auth-slideLeft 0.4s ease-out 0.2s both;
}

.auth-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    animation: auth-slideLeft 0.4s ease-out 0.3s both;
}

.auth-hero h1 .highlight {
    color: var(--bs-primary);
}

.auth-hero p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    animation: auth-slideLeft 0.4s ease-out 0.4s both;
}

.auth-hero .btn-primary {
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.auth-hero .btn-primary:hover {
    transform: translateY(-2px);
}

.auth-hero .btn-outline-light {
    border-width: 2px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.auth-hero .btn-outline-light:hover {
    background: #fff;
    color: #333;
}

/* ── Right Side - Auth Card (animated) ───────────────────── */
.auth-card-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: auth-fadeUp 0.5s ease-out 0.1s both;
}

/* Glassmorphism Card */
.auth-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.auth-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ── Form Styles ─────────────────────────────────────────── */
.auth-form .form-group {
    margin-bottom: 1rem;
    transition: transform 0.15s ease;
    animation: auth-fadeUp 0.3s ease-out both;
}
.auth-form .form-group:nth-child(1) { animation-delay: 0.15s; }
.auth-form .form-group:nth-child(2) { animation-delay: 0.20s; }
.auth-form .form-group:nth-child(3) { animation-delay: 0.25s; }
.auth-form .form-group:nth-child(4) { animation-delay: 0.30s; }
.auth-form .form-group:nth-child(5) { animation-delay: 0.35s; }
.auth-form .form-group:nth-child(6) { animation-delay: 0.40s; }

/* Side by side inputs for signup */
.auth-form .row .input-group {
    border-radius: 50px;
}

.auth-form .row .input-group-text {
    padding: 0.75rem 0.4rem 0.75rem 1rem;
}

.auth-form .row .form-control {
    padding: 0.75rem 0.75rem 0.75rem 0.25rem;
    font-size: 0.9rem;
}

.auth-form .input-group {
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.auth-form .input-group:focus-within {
    box-shadow: 0 2px 15px rgba(var(--bs-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.auth-form .input-group-text {
    background: #fff;
    border: none;
    padding: 0.875rem 0.5rem 0.875rem 1.25rem;
    color: #999;
    transition: color 0.2s ease;
}

.auth-form .input-group:focus-within .input-group-text {
    color: var(--bs-primary);
}

.auth-form .input-group-text i {
    font-size: 1.1rem;
}

.auth-form .form-control {
    border: none;
    padding: 0.875rem 0.5rem;
    font-size: 1rem;
    background: #fff;
    transition: background 0.2s ease;
}

.auth-form .form-control:focus {
    box-shadow: none;
    background: #fff;
}

.auth-form .form-control::placeholder {
    color: #aaa;
    transition: opacity 0.2s ease;
}

.auth-form .form-control:focus::placeholder {
    opacity: 0.5;
}

/* Toggle password button */
.auth-form .input-group .btn {
    background: #fff;
    border: none;
    padding: 0.875rem 1.25rem 0.875rem 0.5rem;
    color: #999;
    transition: color 0.15s ease;
}

.auth-form .input-group .btn:hover {
    color: #333;
}

.forgot-password {
    text-align: right;
    margin-bottom: 1rem;
}

.forgot-password a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.forgot-password a:hover {
    color: var(--bs-primary);
}

/* ── Buttons (animated) ──────────────────────────────────── */
.auth-form .btn-dark {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: auth-fadeUp 0.3s ease-out 0.4s both;
}

.auth-form .btn-dark:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.auth-form .btn-dark:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-form .btn-dark:disabled {
    cursor: not-allowed;
    transform: none;
}

.signup-link {
    text-align: center;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    animation: auth-fadeIn 0.3s ease-out 0.5s both;
}

.signup-link a {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 0.75rem 0;
    animation: auth-fadeIn 0.3s ease-out 0.45s both;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.divider span {
    padding: 0 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Social Buttons */
.auth-form .btn-light {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: auth-fadeUp 0.3s ease-out 0.5s both;
}

.auth-form .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-form .btn-light:active {
    transform: translateY(0) scale(0.98);
}

.auth-form .btn-light img,
.auth-form .btn-light svg {
    width: 20px;
    height: 20px;
}

/* ── Field-level Validation Errors (shared) ──────────────── */
.field-error,
.ob-error {
    color: #f87171;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
    padding-left: 1.25rem;
}

/* Animate error text appearing */
.field-error[style*="display: block"],
.ob-error[style*="display: block"] {
    animation: slideDown 0.25s ease-out;
}

.field-invalid .input-group,
.ob-invalid .input-group,
.ob-invalid .ob-dropdown-toggle {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35) !important;
    animation: shake 0.35s ease-out;
}

.ob-invalid .ob-team-option label {
    border-color: rgba(248, 113, 113, 0.5);
}

/* ── Alert Messages (animated) ───────────────────────────── */
.alert-auth {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-auth:not(.d-none) {
    animation: slideDown 0.3s ease-out;
}

.alert-auth.alert-danger {
    background: rgba(220, 53, 69, 0.9);
    border: none;
    color: #fff;
}

.alert-auth.alert-success {
    background: rgba(40, 167, 69, 0.9);
    border: none;
    color: #fff;
}

/* ── Loading Spinner ─────────────────────────────────────── */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* ── Text colors for glass card ──────────────────────────── */
.auth-card .text-center {
    color: rgba(255, 255, 255, 0.9);
}

.auth-card p {
    color: rgba(255, 255, 255, 0.85);
}

/* ── Responsive Design ───────────────────────────────────── */
@media (max-width: 991.98px) {
    .auth-hero {
        text-align: center;
        padding: 3rem 1rem 2rem;
    }

    .auth-hero h1 {
        font-size: 2rem;
    }

    .auth-hero .btn-group-custom {
        justify-content: center;
    }

    .auth-card-wrapper {
        padding: 1rem;
    }

    .auth-card {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 575.98px) {
    .auth-hero h1 {
        font-size: 1.75rem;
    }

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

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .auth-card h2 {
        font-size: 1.75rem;
    }

    .auth-header .nav-link {
        margin-left: 0;
        padding: 0.5rem 0;
    }
}

/* Hide hero on very small screens for login focus */
@media (max-width: 767.98px) {
    .auth-hero {
        display: none;
    }

    .auth-content {
        justify-content: center;
    }

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

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