/* Login page */

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: linear-gradient(135deg, var(--bg-from), var(--bg-via) 55%, var(--bg-to));
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow-x: hidden;
}

/* Soft drifting colour behind the card */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    pointer-events: none;
    z-index: 0;
}
.blob-1 { width: 420px; height: 420px; background: #5cc9c2; top: -120px; left: -100px; animation: drift-a 18s ease-in-out infinite alternate; }
.blob-2 { width: 380px; height: 380px; background: #a79af0; bottom: -140px; right: -90px; animation: drift-b 22s ease-in-out infinite alternate; }

@keyframes drift-a { to { transform: translate(90px, 70px) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-80px, -60px) scale(1.1); } }

.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
}

.card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 560px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    animation: card-in .7s var(--ease) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* ───────── Welcome panel ───────── */
.welcome {
    position: relative;
    color: #fff;
    background: linear-gradient(160deg, var(--teal-700), var(--teal-500) 55%, var(--teal-400));
    padding: 48px 44px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* faint rings for depth */
.welcome::before, .welcome::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
    pointer-events: none;
}
.welcome::before { width: 360px; height: 360px; top: -140px; left: -120px; }
.welcome::after  { width: 260px; height: 260px; bottom: -90px; left: 20px; }

.welcome-kicker {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .4px;
    opacity: .9;
    animation: rise .7s .25s var(--ease) both;
}

.logo {
    width: 104px;
    height: 104px;
    margin: 22px 0 14px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 30px -10px rgba(4, 50, 54, .55);
    animation: pop .8s .35s var(--ease) both, float 6s 1.2s ease-in-out infinite;
}
.logo svg { width: 52px; height: 52px; }

@keyframes pop {
    from { opacity: 0; transform: scale(.6); }
    to   { opacity: 1; transform: none; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.welcome h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    animation: rise .7s .45s var(--ease) both;
}
.welcome-sub {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 500;
    opacity: .85;
    animation: rise .7s .5s var(--ease) both;
}
.welcome p {
    margin: 26px 0 0;
    max-width: 290px;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 400;
    opacity: .88;
    animation: rise .7s .6s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* Wavy edge between the two panels */
.wave {
    position: absolute;
    pointer-events: none;
}
.wave-side {
    top: 0; right: -1px; height: 100%; width: 150px;
}
.wave-bottom { display: none; left: 0; bottom: -1px; width: 100%; height: 46px; }
.wave .w1 { fill: rgba(255, 255, 255, .28); animation: sway 7s ease-in-out infinite alternate; }
.wave .w2 { fill: rgba(255, 255, 255, .5);  animation: sway 9s ease-in-out infinite alternate-reverse; }
.wave .w3 { fill: var(--panel); }
.wave-side .w1, .wave-side .w2 { transform-origin: 100% 50%; }

@keyframes sway {
    from { transform: translateX(0) scaleX(1); }
    to   { transform: translateX(-9px) scaleX(1.06); }
}

/* ───────── Form panel ───────── */
.form-panel {
    --panel: #fff;
    background: var(--panel);
    padding: 52px 52px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.welcome { --panel: #fff; }

.form-panel h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.3px;
    text-align: center;
    animation: rise .6s .3s var(--ease) both;
}
.form-sub {
    margin: 6px 0 28px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
    animation: rise .6s .36s var(--ease) both;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    animation: shake .45s var(--ease) both;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

.field { margin-bottom: 18px; }
.field:nth-of-type(1) { animation: rise .6s .42s var(--ease) both; }
.field:nth-of-type(2) { animation: rise .6s .5s var(--ease) both; }

label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.input-wrap { position: relative; }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #eef6f6;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
input::placeholder { color: #8ca3a5; }
input:hover { background: #e6f1f1; }
input:focus {
    outline: none;
    background: #fff;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 4px rgba(20, 145, 155, .14);
}

.input-wrap input[type="password"],
.input-wrap input.is-revealed { padding-right: 48px; }

.reveal {
    position: absolute;
    top: 50%; right: 8px;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: none; border: 0; border-radius: 10px;
    color: var(--ink-3);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.reveal:hover { background: rgba(20, 145, 155, .1); color: var(--teal-600); }
.reveal:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 1px; }
.reveal svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reveal .eye-off { display: none; }
.reveal[aria-pressed="true"] .eye { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }

.btn {
    position: relative;
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 12px 24px -12px rgba(11, 110, 115, .8);
    transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
    animation: rise .6s .58s var(--ease) both;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-120%);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(11, 110, 115, .85); }
.btn:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:focus-visible { outline: 3px solid rgba(20, 145, 155, .45); outline-offset: 3px; }

.btn .spinner {
    display: none;
    width: 18px; height: 18px;
    margin: 0 auto;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn.is-loading { pointer-events: none; filter: saturate(.85); }
.btn.is-loading .label { display: none; }
.btn.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.powered {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-3);
    animation: rise .6s .7s var(--ease) both;
}
.powered a { color: var(--teal-600); font-weight: 500; text-decoration: none; }
.powered a:hover { text-decoration: underline; }

/* ───────── Tablet & phone ───────── */
@media (max-width: 820px) {
    .card { grid-template-columns: 1fr; min-height: 0; }
    .welcome { padding: 34px 28px 64px; }
    .welcome::before, .welcome::after { display: none; }
    .logo { width: 76px; height: 76px; margin: 14px 0 10px; }
    .logo svg { width: 38px; height: 38px; }
    .welcome h1 { font-size: 19px; }
    .welcome p { display: none; }
    .wave-side { display: none; }
    .wave-bottom { display: block; }
    .form-panel { padding: 30px 26px 28px; }
}

@media (max-width: 420px) {
    body { padding: 14px 10px; }
    .form-panel { padding: 26px 20px 24px; }
}
