@import url('https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700,800');

:root {
    --brand-navy-dark: #141d4d;
    --brand-navy: #1e2a6e;
    --brand-navy-light: #33409a;
    --brand-yellow: #ffd23f;
    --brand-yellow-deep: #f0a800;
    --panel-ink: #1c2650;
    --panel-ink-muted: rgba(28, 38, 80, 0.68);
    --ink: #23252b;
    --muted: #8a8d94;
    --border: #e7e7eb;
    --danger: #e0504f;
}

html, body.login-page {
    height: 100%;
}

body.login-page {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 15% 15%, #f6f7fb 0%, #e7e9f0 55%, #dde0ea 100%);
}

.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 1040px;
    min-height: 600px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 40px 80px -32px rgba(20, 29, 77, 0.32),
        0 12px 28px -12px rgba(20, 29, 77, 0.18);
    animation: wrapperIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ---------- Brand panel ---------- */

.login-brand {
    position: relative;
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 44px;
    overflow: hidden;
    color: var(--panel-ink);
    background: linear-gradient(160deg, var(--brand-yellow) 0%, var(--brand-yellow-deep) 100%);
    text-align: center;
}

.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    animation: blobFloat 10s ease-in-out infinite;
}

.login-brand::before {
    width: 460px;
    height: 460px;
    top: -200px;
    left: -180px;
}

.login-brand::after {
    width: 320px;
    height: 320px;
    bottom: -160px;
    right: -130px;
    background: rgba(20, 29, 77, 0.06);
    animation-duration: 13s;
    animation-direction: reverse;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, 20px) scale(1.06); }
}

.login-brand__content {
    position: relative;
    z-index: 1;
    max-width: 320px;
}

.login-brand__logo-wrap {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 18px 40px -14px rgba(20, 29, 77, 0.35);
    margin-bottom: 30px;
    backdrop-filter: blur(2px);
    animation: logoIn 0.7s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-brand__logo-wrap:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 24px 48px -16px rgba(20, 29, 77, 0.4);
}

@keyframes logoIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand__logo-wrap img {
    display: block;
    width: 188px;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.login-brand__content p {
    font-size: 13.5px;
    line-height: 22px;
    letter-spacing: 0.2px;
    color: var(--panel-ink-muted);
    margin: 0;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand__features {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    text-align: left;
}

.login-brand__features li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 13px;
    letter-spacing: 0.2px;
    color: var(--panel-ink);
    margin-bottom: 14px;
    opacity: 0;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.2s ease;
}

.login-brand__features li:nth-child(1) { animation-delay: 0.3s; }
.login-brand__features li:nth-child(2) { animation-delay: 0.4s; }
.login-brand__features li:nth-child(3) { animation-delay: 0.5s; }

.login-brand__features li:hover {
    transform: translateX(3px);
}

.login-brand__features i {
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.login-brand__features li:hover i {
    transform: scale(1.15) rotate(-8deg);
}

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

/* ---------- Form panel ---------- */

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 340px;
    opacity: 0;
    animation: fadeUp 0.6s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card__header {
    margin-bottom: 26px;
}

.login-card__header h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin: 0 0 6px;
    text-align: left;
    color: var(--ink);
}

.login-card__header p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    text-align: left;
}

.auth-tabs {
    position: relative;
    display: flex;
    gap: 0;
    background: #f1f2f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tabs__indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 3px 10px rgba(20, 29, 77, 0.1);
    transition: transform 0.28s cubic-bezier(0.65, 0, 0.35, 1);
}

.auth-tabs.signup .auth-tabs__indicator {
    transform: translateX(100%);
}

.auth-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-tab.active {
    color: var(--brand-navy);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.field {
    margin-bottom: 16px;
    text-align: left;
}

.field label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--ink);
    margin-bottom: 6px;
}

.field .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field .input-wrap i.leading {
    position: absolute;
    left: 14px;
    font-size: 13px;
    color: var(--muted);
    transition: color 0.15s ease, transform 0.15s ease;
}

.field .input-wrap:focus-within i.leading {
    color: var(--brand-navy);
    transform: scale(1.08);
}

.field input {
    width: 100%;
    box-sizing: border-box;
    background: #fafafc;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 14px 11px 40px;
    font-size: 13.5px;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
    color: #b0b2ba;
    font-size: 13px;
}

.field input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px rgba(30, 42, 110, 0.1);
}

.field.has-error input {
    border-color: var(--danger);
    animation: fieldShake 0.4s ease;
}

@keyframes fieldShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.field .toggle-visibility {
    position: absolute;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
}

.field .toggle-visibility:focus {
    outline: none;
}

.form-meta {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 18px;
}

.form-meta a {
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.form-meta a:hover {
    color: var(--brand-navy);
    text-decoration: underline;
}

.btn-submit {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: none;
    border-radius: 9px;
    background: var(--brand-navy);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 10px 20px -8px rgba(30, 42, 110, 0.5);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 120%;
}

.btn-submit:hover {
    background: var(--brand-navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 24px -8px rgba(30, 42, 110, 0.55);
}

.btn-submit:active {
    transform: translateY(0) scale(0.98);
}

.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 42, 110, 0.25);
}

.btn-submit.is-loading {
    color: transparent;
    pointer-events: none;
}

.btn-submit.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    body.login-page {
        padding: 0;
    }

    .login-wrapper {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        flex: 1;
        padding: 24px;
    }

    .login-card {
        max-width: 380px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-wrapper,
    .login-card,
    .login-brand__logo-wrap,
    .login-brand__content p,
    .login-brand__features li,
    .login-brand::before,
    .login-brand::after,
    .field.has-error input,
    .btn-submit::before,
    .btn-submit.is-loading::after {
        animation: none !important;
        transition: none !important;
    }

    .login-card,
    .login-brand__content p,
    .login-brand__features li {
        opacity: 1 !important;
    }
}
