:root {
    --brand: #0a6cb4;
    --brand-dark: #074e82;
    --brand-light: #2f9fe0;
    --ink: #1f2d3d;
    --muted: #6b7a90;
    --line: #e3e9f1;
    --danger: #d64545;
    --danger-bg: #fdecec;
}

* { box-sizing: border-box; }
.d-none { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(135deg, #0a6cb4 0%, #074e82 55%, #053a61 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
/* decorative soft blobs */
body::before, body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .18;
    background: #ffffff;
}
body::before { width: 420px; height: 420px; top: -140px; right: -120px; }
body::after  { width: 320px; height: 320px; bottom: -120px; left: -100px; opacity: .12; }

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(5, 41, 70, .35);
    padding: 40px 36px 32px;
    animation: rise .5s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    text-align: center;
    margin-bottom: 26px;
}
.brand img {
    height: 64px;
    width: auto;
    margin-bottom: 14px;
}
.brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--brand-dark);
}
.brand p {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.alert {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f6c9c9;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert svg { flex: 0 0 auto; }

.field { margin-bottom: 18px; }
.field > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrap > .icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    display: flex;
    pointer-events: none;
}
.input-wrap input {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 0 44px;
    font-size: 15px;
    color: var(--ink);
    background: #f8fafc;
    transition: border-color .15s, box-shadow .15s, background .15s;
    outline: none;
}
.input-wrap input::placeholder { color: #aab4c2; }
.input-wrap input:focus {
    border-color: var(--brand-light);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 159, 224, .15);
}
.toggle-pass {
    position: absolute;
    right: 8px;
    height: 36px;
    width: 36px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.toggle-pass:hover { color: var(--brand); background: #eef4fb; }

.totp-hint {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
#two-factor-container input {
    letter-spacing: 6px;
    text-align: center;
    font-weight: 600;
    padding: 0 16px;
}

.btn-submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 60%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 10px 24px rgba(10, 108, 180, .35);
    transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-submit:hover { filter: brightness(1.05); box-shadow: 0 12px 28px rgba(10, 108, 180, .45); }
.btn-submit:active { transform: translateY(1px); }

.alt-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: #9aa6b6;
    font-size: 12.5px;
}
.alt-sep::before, .alt-sep::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--line);
}
.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--brand);
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-register:hover { background: #eef4fb; }

.foot {
    text-align: center;
    margin-top: 22px;
    font-size: 12.5px;
    color: #9aa6b6;
}

@media (max-width: 480px) {
    .login-card { padding: 32px 22px 26px; border-radius: 16px; }
    .brand img { height: 56px; }
}