/* ========== LOGIN - DARK MODERN DESIGN ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --login-bg: #0c0f14;
    --login-card: rgba(22, 27, 38, 0.85);
    --login-card-border: rgba(255, 255, 255, 0.06);
    --login-accent: #20A789;
    --login-accent-hover: #1b9477;
    --login-accent-glow: rgba(32, 167, 137, 0.25);
    --login-text: #f1f5f9;
    --login-text-muted: #8892a4;
    --login-text-subtle: #5a6377;
    --login-input-bg: rgba(255, 255, 255, 0.04);
    --login-input-border: rgba(255, 255, 255, 0.08);
    --login-input-focus: rgba(32, 167, 137, 0.5);
    --login-danger: #ef4444;
    --login-warning: #f59e0b;
    --login-radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--login-bg);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* ========== BACKGROUND ORBS ========== */
.login-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.login-orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #20A789, transparent 70%);
    top: -200px;
    right: -150px;
    opacity: 0.2;
    animation: orbFloat1 20s ease-in-out infinite alternate;
}

.login-orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    bottom: -200px;
    left: -150px;
    opacity: 0.15;
    animation: orbFloat2 18s ease-in-out infinite alternate;
}

.login-orb--3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #0ea5e9, transparent 70%);
    top: 40%;
    left: 45%;
    opacity: 0.06;
    animation: orbFloat3 22s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 80px) scale(1.15); }
}

@keyframes orbFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -60px) scale(1.1); }
}

@keyframes orbFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, -50px) scale(1.3); }
}

/* ========== WRAPPER ========== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 40px 24px;
}

/* ========== CARD ========== */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--login-card);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    border: 1px solid var(--login-card-border);
    border-radius: 24px;
    padding: 44px 40px 36px;
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top accent glow line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--login-accent), transparent);
    opacity: 0.7;
}

/* Inner glow at top */
.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100px;
    background: radial-gradient(ellipse at top, rgba(32, 167, 137, 0.06), transparent);
    pointer-events: none;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== HEADER ========== */
.login-card__header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

#background-unabase,
.login-logo-demo {
    width: 100%;
    height: 40px;
    margin-bottom: 28px;
}

#background-unabase img {
    margin-bottom: 25px;
}

.login-card__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--login-text);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.login-card__subtitle {
    font-size: 14px;
    color: var(--login-text-muted);
    font-weight: 400;
    line-height: 1.5;
}

/* ========== ALERT ========== */
.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    animation: alertIn 0.3s ease;
    position: relative;
    z-index: 1;
}

.login-alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.login-alert--error .login-alert__icon { color: #ef4444; }

.login-alert--warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.login-alert--warning .login-alert__icon { color: #f59e0b; }

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

.login-alert__icon {
    flex-shrink: 0;
    display: flex;
}

.login-alert__text {
    line-height: 1.4;
}

/* ========== FIELDS ========== */
.login-field {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.login-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--login-text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.login-field__input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--login-input-bg);
    border: 1.5px solid var(--login-input-border);
    border-radius: var(--login-radius);
    padding: 0 16px;
    height: 50px;
    transition: all 0.25s ease;
}

.login-field__input-wrap.focused,
.login-field__input-wrap:focus-within {
    border-color: var(--login-input-focus);
    background: rgba(32, 167, 137, 0.04);
    box-shadow: 0 0 0 4px rgba(32, 167, 137, 0.06);
}

.login-field__icon {
    color: var(--login-text-subtle);
    flex-shrink: 0;
    transition: color 0.25s ease;
}

.login-field__input-wrap.focused .login-field__icon,
.login-field__input-wrap:focus-within .login-field__icon {
    color: var(--login-accent);
}

.login-field__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--login-text);
    height: 100%;
    min-width: 0;
}

.login-field__input::placeholder {
    color: var(--login-text-subtle);
    font-weight: 400;
}

/* Select styling */
.login-field__select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.login-field__select-wrap::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--login-text-subtle);
    flex-shrink: 0;
    pointer-events: none;
}

.login-field__select option {
    background: #1a1f2e;
    color: var(--login-text);
    padding: 8px;
}

/* Toggle password */
.login-field__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--login-text-subtle);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.login-field__toggle:hover {
    color: var(--login-text-muted);
    background: rgba(255, 255, 255, 0.05);
}

/* ========== OPTIONS ROW ========== */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    position: relative;
    z-index: 1;
}

/* Custom checkbox */
.login-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--login-text-muted);
    user-select: none;
    margin-bottom: 0;
}

.login-checkbox input {
    display: none;
}

.login-checkbox__mark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--login-input-border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    background: var(--login-input-bg);
}

.login-checkbox input:checked + .login-checkbox__mark {
    background: var(--login-accent);
    border-color: var(--login-accent);
}

.login-checkbox input:checked + .login-checkbox__mark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-0.5px, -0.5px);
}

.login-checkbox__text {
    font-weight: 400;
    line-height: 1;
}

/* Forgot password link */
.login-link {
    font-size: 13px;
    color: var(--login-accent);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 0;
    transition: all 0.2s ease;
}

.login-link:hover {
    color: #2dd4a8;
    text-decoration: underline;
}

/* ========== BUTTONS ========== */
.login-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.login-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--login-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

/* Primary */
.login-btn--primary {
    background: linear-gradient(135deg, #20A789 0%, #17946f 100%);
    color: #fff;
    box-shadow:
        0 4px 20px var(--login-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-btn--primary:hover {
    box-shadow:
        0 8px 32px rgba(32, 167, 137, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.login-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--login-accent-glow);
}

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

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

/* Secondary */
.login-btn--secondary {
    background: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.login-btn--secondary:hover {
    background: rgba(14, 165, 233, 0.18);
    transform: translateY(-1px);
}

/* Outline */
.login-btn--outline {
    background: transparent;
    color: var(--login-text-muted);
    border: 1.5px solid var(--login-input-border);
}

.login-btn--outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--login-text);
}

/* ========== FOOTER ========== */
.login-card__footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

.login-card__footer-text {
    font-size: 12px;
    color: var(--login-text-subtle);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ========== HIDE UTILITY ========== */
.hide {
    display: none !important;
}

/* ========== VERIFY CODE MODAL (dark themed) ========== */
.login-modal-content {
    background: #1a1f2e !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 20px !important;
    overflow: hidden;
}

.login-modal-header {
    background: linear-gradient(135deg, var(--login-accent) 0%, #17946f 100%) !important;
    border: none !important;
    padding: 20px 24px;
}

.login-modal-header .modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #fff;
}

.login-modal-header .close {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: none;
}

.login-modal-body {
    padding: 28px 24px;
    font-family: 'Inter', sans-serif;
}

.login-modal-body p {
    color: var(--login-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-modal-body .code-input {
    background: var(--login-input-bg) !important;
    border: 1.5px solid var(--login-input-border) !important;
    border-radius: 14px !important;
    height: 56px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 12px;
    text-align: center;
    color: var(--login-text) !important;
    font-family: 'Inter', sans-serif;
}

.login-modal-body .code-input:focus {
    border-color: var(--login-input-focus) !important;
    box-shadow: 0 0 0 4px rgba(32, 167, 137, 0.08) !important;
    background: rgba(32, 167, 137, 0.04) !important;
}

.login-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    padding: 16px 24px 24px;
    gap: 10px;
}

/* ========== HIDE OLD BOOTSTRAP ELEMENTS ========== */
.card,
.card.bg-danger,
.input-group,
.input-group-prepend,
.navbar.fixed-bottom,
section,
section + footer {
    display: none !important;
}

/* Old demo form - hide it since we rebuilt it */
form.demo {
    display: contents;
}

/* ========== RECOVERY CONTAINERS (dark themed) ========== */
.password-recovery-container,
.verif-email-wrapper,
.newpass-wrapper {
    position: relative;
    z-index: 1;
    background: var(--login-card) !important;
    border: 1px solid var(--login-card-border) !important;
    border-radius: 24px !important;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    color: var(--login-text);
}

.password-recovery-container *,
.verif-email-wrapper *,
.newpass-wrapper * {
    font-family: 'Inter', sans-serif;
}

.verif-email-title,
.newpass-title,
.password-recovery-title {
    color: var(--login-text) !important;
}

.verif-email-text,
.newpass-text,
.password-recovery-instructions {
    color: var(--login-text-muted) !important;
}

.newpass-text ul li {
    color: var(--login-text-muted) !important;
}

.newpass-label {
    color: var(--login-text-muted) !important;
}

.verif-code-input,
.newpass-input,
.password-recovery-email-input {
    background: var(--login-input-bg) !important;
    border: 1.5px solid var(--login-input-border) !important;
    color: var(--login-text) !important;
    border-radius: 12px !important;
    font-family: 'Inter', sans-serif !important;
}

.verif-code-input:focus,
.newpass-input:focus,
.password-recovery-email-input:focus {
    border-color: var(--login-input-focus) !important;
    box-shadow: 0 0 0 4px rgba(32, 167, 137, 0.08) !important;
    background: rgba(32, 167, 137, 0.04) !important;
}

.verif-btn,
.newpass-button,
.password-recovery-submit-button {
    background: linear-gradient(135deg, #20A789 0%, #17946f 100%) !important;
    border: none !important;
    border-radius: var(--login-radius) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: 0 4px 16px var(--login-accent-glow) !important;
    transition: all 0.25s ease !important;
}

.verif-btn:hover,
.newpass-button:hover,
.password-recovery-submit-button:hover {
    box-shadow: 0 8px 24px rgba(32, 167, 137, 0.35) !important;
    transform: translateY(-2px);
}

.newpass-img {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 28px;
        border-radius: 20px;
        max-width: 100%;
    }

    .login-card__title {
        font-size: 22px;
    }

    .login-field__input-wrap {
        height: 46px;
    }

    .login-btn {
        height: 46px;
        font-size: 14px;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ========== AUTOFILL FIX FOR DARK THEME ========== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--login-text) !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(22, 27, 38, 1) inset !important;
    box-shadow: 0 0 0 1000px rgba(22, 27, 38, 1) inset !important;
    caret-color: var(--login-text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ========== LOADING OVERLAY ========== */
.login-loading[hidden] {
    display: none !important;
}

.login-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-loading__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--login-bg);
    opacity: 0;
    animation: loadingFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loadingFadeIn {
    to { opacity: 0.95; }
}

.login-loading__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    opacity: 0;
    transform: scale(0.9);
    animation: loadingContentIn 0.5s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loadingContentIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-loading__logo-ring {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-loading__spinner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: loadingSpin 1.4s linear infinite;
}

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

.login-loading__logo {
    animation: loadingPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(32, 167, 137, 0.3));
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.login-loading__text {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--login-text-muted);
    letter-spacing: 0.02em;
    margin: 0;
}

.login-loading__dots::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0%  { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.login-loading__bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.login-loading__bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #20A789, #0ea5e9);
    border-radius: 3px;
    animation: loadingBar 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 0 12px rgba(32, 167, 137, 0.4);
}

@keyframes loadingBar {
    0%   { width: 0%; }
    20%  { width: 25%; }
    50%  { width: 55%; }
    80%  { width: 80%; }
    100% { width: 95%; }
}
