@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
    --auth-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --auth-bg: #f8fafc;
    --auth-panel: #0f172a;
    --auth-panel-accent: #1d4ed8;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #ffffff;
    --auth-primary: #2563eb;
    --auth-primary-hover: #1d4ed8;
    --auth-primary-glow: rgba(37, 99, 235, 0.25);
    --auth-radius: 14px;
    --auth-radius-sm: 10px;
    --auth-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.12);
    --auth-transition: 180ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--auth-font);
    color: var(--auth-text);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }
}

/* Brand panel */
.auth-brand {
    position: relative;
    display: none;
    overflow: hidden;
    padding: 3rem;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
}

@media (min-width: 992px) {
    .auth-brand {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    pointer-events: none;
}

.auth-brand::before {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: #60a5fa;
}

.auth-brand::after {
    width: 280px;
    height: 280px;
    bottom: -40px;
    left: -40px;
    background: #818cf8;
}

.auth-brand__content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    text-align: center;
}

.auth-brand__illustration {
    margin: 0 auto 2rem;
    max-width: 380px;
}

.auth-brand__illustration img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
}

.auth-brand__title {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-brand__subtitle {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

/* Form panel */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    animation: authFadeUp 0.5s ease both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.auth-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--auth-primary);
    box-shadow: var(--auth-shadow);
    border: 1px solid #bfdbfe;
    pointer-events: none;
    user-select: none;
}

.auth-brand-icon--lg {
    width: 72px;
    height: 72px;
}

.auth-brand-icon--lg svg {
    width: 32px;
    height: 32px;
}

.auth-brand-icon--sm {
    width: 52px;
    height: 52px;
}

.auth-brand-icon--sm svg {
    width: 24px;
    height: 24px;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--auth-text);
}

.auth-card__subtitle {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--auth-muted);
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: var(--auth-font);
    font-size: 0.95rem;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    outline: none;
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-input-wrap .form-control::placeholder {
    color: #94a3b8;
}

.auth-input-wrap .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

.auth-input-wrap--password .form-control {
    padding-right: 2.75rem;
}

.auth-toggle-password {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    transition: color var(--auth-transition), background var(--auth-transition);
}

.auth-toggle-password:hover {
    color: var(--auth-primary);
    background: #eff6ff;
}

.auth-toggle-password svg {
    display: block;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0.15rem 0 0;
    accent-color: var(--auth-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox span {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.45;
}

.auth-checkbox a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    white-space: nowrap;
}

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

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-family: var(--auth-font);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    box-shadow: 0 8px 24px -4px var(--auth-primary-glow);
    transition: transform var(--auth-transition), box-shadow var(--auth-transition), filter var(--auth-transition);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -4px var(--auth-primary-glow);
    filter: brightness(1.03);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-footer p {
    margin: 0 0 0.5rem;
}

.auth-footer p:last-child {
    margin-bottom: 0;
}

.auth-footer a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* OTP inputs */
.auth-otp {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.auth-otp input {
    width: 3.25rem;
    height: 3.5rem;
    text-align: center;
    font-family: var(--auth-font);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    outline: none;
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-otp input:focus,
.auth-otp input.filled {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

@media (max-width: 420px) {
    .auth-otp {
        gap: 0.5rem;
    }

    .auth-otp input {
        width: 2.75rem;
        height: 3rem;
        font-size: 1.15rem;
    }
}

/* Bootstrap validation overrides */
.auth-form .invalid-feedback {
    display: none;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #ef4444;
}

.auth-form.was-validated .auth-field .form-control:invalid {
    border-color: #ef4444;
}

.auth-form.was-validated .auth-field .form-control:valid {
    border-color: #22c55e;
}

.auth-form.was-validated .auth-field .form-control:invalid ~ .invalid-feedback,
.auth-form.was-validated .auth-field:has(.form-control:invalid) > .invalid-feedback,
.auth-form.was-validated .auth-field:has(input[type="checkbox"]:invalid) > .invalid-feedback {
    display: block;
}

/* Mobile brand strip */
.auth-mobile-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .auth-mobile-brand {
        display: none;
    }
}
