﻿:root {
    --flow-bg: #eef2f7;
    --flow-card-bg: #ffffff;
    --flow-text: #122033;
    --flow-muted: #6c7a92;
    --flow-line: #dbe3ef;

    --flow-primary: #1f3a8a;
    --flow-primary-2: #2f66ff;
    --flow-primary-3: #eaf0ff;

    --flow-accent: #ef4e48;
    --flow-accent-hover: #e4423d;

    --flow-success: #1f8f63;
    --flow-shadow: 0 22px 55px rgba(24, 39, 75, 0.16), 0 8px 24px rgba(24, 39, 75, 0.12);
    --flow-radius-xl: 28px;
    --flow-radius-lg: 18px;
    --flow-radius-md: 14px;

    --flow-ease: cubic-bezier(.2, .8, .2, 1);
}

html,
body {
    min-height: 100%;
}

body.flow-login-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(47, 102, 255, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(239, 78, 72, 0.10), transparent 24%),
        linear-gradient(180deg, #f5f7fb 0%, #eef2f7 100%);
    font-family: 'Outfit', sans-serif;
    color: var(--flow-text);
}

.flow-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.flow-login-card {
    width: 100%;
    max-width: 1160px;
    min-height: 700px;
    background: var(--flow-card-bg);
    border-radius: var(--flow-radius-xl);
    overflow: hidden;
    box-shadow: var(--flow-shadow);
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    position: relative;
    animation: flowCardIn .7s var(--flow-ease);
}

@keyframes flowCardIn {
    from {
        opacity: 0;
        transform: translateY(22px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.flow-login-brand-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, #18325f 0%, #244d9f 42%, #2f66ff 100%);
    color: #fff;
    padding: 48px;
    display: flex;
    align-items: center;
}

.flow-brand-content {
    position: relative;
    z-index: 2;
    max-width: 430px;
    animation: flowFadeUp .8s .08s both var(--flow-ease);
}

.flow-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.flow-brand-title {
    font-size: clamp(56px, 8vw, 88px);
    line-height: .95;
    font-weight: 800;
    letter-spacing: -.04em;
    margin-bottom: 18px;
}

.flow-brand-subtitle {
    font-size: 18px;
    line-height: 1.65;
    color: rgba(255,255,255,.88);
    max-width: 360px;
    margin-bottom: 28px;
}

.flow-brand-points {
    display: grid;
    gap: 14px;
}

.flow-brand-point {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.94);
    font-size: 15px;
}

.flow-brand-point-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 6px rgba(255,255,255,.12);
    flex: 0 0 auto;
}

.flow-brand-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    opacity: .55;
    pointer-events: none;
}

.flow-brand-glow-one {
    width: 280px;
    height: 280px;
    right: -40px;
    top: -30px;
    background: rgba(255,255,255,.14);
    animation: floatOne 9s ease-in-out infinite;
}

.flow-brand-glow-two {
    width: 220px;
    height: 220px;
    left: -50px;
    bottom: -40px;
    background: rgba(255,255,255,.10);
    animation: floatTwo 11s ease-in-out infinite;
}

@keyframes floatOne {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-14px, 16px); }
}

@keyframes floatTwo {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(18px, -10px); }
}

.flow-login-form-panel {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 36px;
}

.flow-login-panel-inner {
    width: 100%;
    max-width: 470px;
    animation: flowFadeUp .8s .14s both var(--flow-ease);
}

@keyframes flowFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flow-login-header h1 {
    font-size: 42px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -.03em;
    margin: 0 0 10px;
    color: var(--flow-text);
}

.flow-login-header p {
    margin: 0 0 28px;
    color: var(--flow-muted);
    font-size: 17px;
    line-height: 1.6;
}

.flow-login-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #fff;
    border: 1px solid #cfd8ea;
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 28px;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
}

.flow-mode-btn {
    border: 0;
    background: transparent;
    color: #60708d;
    border-radius: 12px;
    min-height: 52px;
    font-size: 16px;
    font-weight: 600;
    transition: all .25s var(--flow-ease);
    cursor: pointer;
    padding: 0 18px;
}

.flow-mode-btn:hover {
    color: var(--flow-primary);
    background: #f6f8fc;
}

.flow-mode-btn.active {
    background: #1f3a6f;
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 58, 111, .18);
}

.flow-login-panels {
    position: relative;
}

.flow-login-panel {
    animation: flowPanelIn .28s var(--flow-ease);
}

.flow-login-panel.is-leaving {
    animation: flowPanelOut .18s ease forwards;
}

@keyframes flowPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flowPanelOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(4px);
    }
}

.flow-panel-heading {
    margin-bottom: 20px;
}

.flow-panel-heading h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    color: var(--flow-text);
}

.flow-panel-heading p {
    margin: 0;
    color: var(--flow-muted);
    font-size: 15px;
    line-height: 1.55;
}

.flow-auth-form {
    width: 100%;
}

.flow-sso-list {
    display: grid;
    gap: 14px;
}

.flow-sso-btn {
    width: 100%;
    border: 1px solid #d8e0ee;
    border-radius: 18px;
    background: #fff;
    min-height: 74px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    transition: transform .22s var(--flow-ease), box-shadow .22s var(--flow-ease), border-color .22s var(--flow-ease), background .22s var(--flow-ease);
    cursor: pointer;
}

.flow-sso-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(21, 36, 71, 0.10);
    border-color: #c5d3ed;
    background: #fbfcff;
}

.flow-sso-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(47, 102, 255, 0.14);
}

.flow-sso-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e3e8f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.flow-sso-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.flow-sso-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.flow-sso-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--flow-text);
}

.flow-sso-subtitle {
    font-size: 13px;
    color: var(--flow-muted);
    margin-top: 3px;
}

.flow-ms-box {
    background: #fff;
}

.flow-ms-grid {
    width: 22px;
    height: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.flow-ms-grid span:nth-child(1) { background: #f25022; }
.flow-ms-grid span:nth-child(2) { background: #7fba00; }
.flow-ms-grid span:nth-child(3) { background: #00a4ef; }
.flow-ms-grid span:nth-child(4) { background: #ffb900; }

.flow-divider {
    position: relative;
    text-align: center;
    margin: 24px 0 18px;
}

.flow-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--flow-line);
}

.flow-divider span {
    position: relative;
    display: inline-block;
    background: #fff;
    padding: 0 12px;
    color: var(--flow-muted);
    font-size: 13px;
    font-weight: 500;
}

.flow-link-btn {
    width: 100%;
    border: 1px dashed #ccd7eb;
    background: #fafcff;
    color: var(--flow-primary);
    border-radius: 16px;
    min-height: 54px;
    font-size: 15px;
    font-weight: 600;
    transition: all .22s var(--flow-ease);
    cursor: pointer;
}

.flow-link-btn:hover {
    background: #f3f7ff;
    border-color: #b8caeb;
}

.flow-field {
    margin-bottom: 18px;
}

.flow-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--flow-text);
}

.flow-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.flow-inline-link,
.flow-form-links a {
    color: var(--flow-primary-2);
    text-decoration: none;
    font-weight: 500;
}

.flow-inline-link:hover,
.flow-form-links a:hover {
    color: var(--flow-primary);
    text-decoration: none;
}

.flow-input.form-control {
    height: 58px;
    border-radius: 16px;
    border: 1px solid #cfd8ea;
    background: #fff;
    padding: 0 18px;
    font-size: 16px;
    color: var(--flow-text);
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.flow-input.form-control::placeholder {
    color: #8a98b1;
}

.flow-input.form-control:focus {
    border-color: #7ea3ff;
    box-shadow: 0 0 0 4px rgba(47, 102, 255, 0.12);
}

.flow-checkbox-row {
    margin-top: 6px;
    margin-bottom: 22px;
}

.flow-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--flow-muted);
    font-weight: 500;
    margin: 0;
}

.flow-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--flow-primary-2);
}

.flow-submit-btn {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--flow-accent) 0%, #ff6b5d 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 14px 24px rgba(239, 78, 72, 0.22);
    transition: transform .22s var(--flow-ease), box-shadow .22s var(--flow-ease), filter .22s var(--flow-ease);
    cursor: pointer;
}

.flow-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(239, 78, 72, 0.28);
    filter: brightness(1.01);
}

.flow-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(239, 78, 72, 0.16);
}

.flow-form-links {
    margin-top: 16px;
    text-align: center;
}

.flow-validation-summary {
    margin-bottom: 16px;
    border-radius: 14px;
    background: #fff4f3;
    border: 1px solid #ffd7d3;
    padding: 12px 14px;
}

.validation-summary-valid {
    display: none;
}

.text-danger {
    font-size: 13px;
}

.flow-register-card {
    min-height: 760px;
}

.flow-register-panel-inner {
    max-width: 520px;
}

.flow-register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.flow-password-label-row {
    justify-content: flex-start;
}

.flow-password-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.flow-password-help {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid #2d3748;
    background: #fff;
    color: #2d3748;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    padding: 0;
    flex: 0 0 auto;
}

.flow-password-help-popup {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    width: 290px;
    background: #122033;
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    box-shadow: 0 18px 36px rgba(18, 32, 51, 0.24);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 20;
}

.flow-password-help-popup::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #122033;
    transform: translateX(-50%) rotate(45deg);
}

.flow-password-help:hover .flow-password-help-popup {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.flow-password-help-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.flow-password-help-popup ul {
    margin: 0;
    padding-left: 18px;
}

.flow-password-help-popup li {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    line-height: 1.45;
}

.flow-password-help-popup li:last-child {
    margin-bottom: 0;
}


@media (max-width: 991.98px) {
    .flow-login-shell {
        padding: 18px;
    }

    .flow-register-card {
        min-height: auto;
    }

    .flow-login-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .flow-login-brand-panel {
        min-height: 260px;
        padding: 32px 24px;
    }

    .flow-brand-content {
        max-width: 100%;
    }

    .flow-brand-title {
        font-size: 58px;
    }

    .flow-login-form-panel {
        padding: 28px 20px 30px;
    }

    .flow-login-panel-inner {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .flow-login-shell {
        padding: 12px;
    }

    .flow-login-card {
        border-radius: 22px;
    }

    .flow-login-brand-panel {
        min-height: 210px;
        padding: 26px 20px;
    }

    .flow-brand-badge {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .flow-brand-title {
        font-size: 46px;
        margin-bottom: 12px;
    }

    .flow-brand-subtitle {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .flow-brand-points {
        gap: 10px;
    }

    .flow-brand-point {
        font-size: 13px;
    }

    .flow-login-form-panel {
        padding: 22px 16px 22px;
    }

    .flow-login-header h1 {
        font-size: 34px;
    }

    .flow-login-header p {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .flow-login-mode-switch {
        margin-bottom: 22px;
        padding: 5px;
        border-radius: 14px;
    }

    .flow-mode-btn {
        min-height: 48px;
        font-size: 14px;
        padding: 0 10px;
    }

    .flow-panel-heading h2 {
        font-size: 21px;
    }

    .flow-panel-heading p {
        font-size: 14px;
    }

    .flow-sso-btn {
        min-height: 68px;
        border-radius: 16px;
        padding: 12px 14px;
        gap: 12px;
    }

    .flow-sso-title {
        font-size: 15px;
    }

    .flow-sso-subtitle {
        font-size: 12px;
    }

    .flow-input.form-control {
        height: 54px;
        border-radius: 14px;
        font-size: 15px;
    }

    .flow-submit-btn,
    .flow-link-btn {
        min-height: 52px;
        border-radius: 14px;
        font-size: 15px;
    }

    .flow-field-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .flow-register-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .flow-register-panel-inner {
        max-width: 100%;
    }

    .flow-password-help-popup {
        left: 0;
        transform: translateX(0) translateY(6px);
        width: 250px;
    }

    .flow-password-help-popup::before {
        left: 18px;
        transform: rotate(45deg);
    }

    .flow-password-help:hover .flow-password-help-popup {
        transform: translateX(0) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}