* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    overflow: hidden;
    position: relative;
    color: #17324a;
    background:
        radial-gradient(circle at 18% 20%, rgba(132, 190, 235, 0.34), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(168, 211, 241, 0.28), transparent 22%),
        radial-gradient(circle at 50% 82%, rgba(124, 171, 214, 0.20), transparent 28%),
        linear-gradient(135deg, #b9cada 0%, #a6bbcf 45%, #b2c4d7 100%);
}

/* =========================
   BACKGROUND
   ========================= */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.10) 0 16%, transparent 16% 84%, rgba(255,255,255,0.10) 84% 100%);
    opacity: 0.32;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 44%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(69, 107, 143, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(69, 107, 143, 0.08) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at center, black 24%, rgba(0,0,0,0.45) 56%, transparent 82%);
}

.bg-shape {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}

.bg-shape-1 {
    width: 760px;
    height: 760px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(92, 132, 168, 0.10);
    box-shadow:
        0 0 0 36px rgba(255,255,255,0.025),
        0 0 0 88px rgba(255,255,255,0.015);
    opacity: 0.72;
    animation: slowSpin 36s linear infinite;
}

.bg-shape-2 {
    width: 520px;
    height: 520px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle, rgba(118, 180, 230, 0.16) 0%, rgba(118, 180, 230, 0.08) 34%, transparent 68%);
    filter: blur(8px);
    animation: breathe 8s ease-in-out infinite;
}

/* =========================
   TOAST
   ========================= */

.login-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-14px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(227, 238, 247, 0.92);
    color: #254560;
    border: 1px solid rgba(108, 156, 197, 0.20);
    box-shadow: 0 14px 34px rgba(64, 108, 150, 0.12);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
    font-weight: 700;
}

.login-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(33, 67, 95, 0.18);
    border-top-color: #4a95d9;
    animation: spin 0.8s linear infinite;
}

/* =========================
   SHELL
   ========================= */

.reinsurance-login-shell {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* =========================
   CARD
   ========================= */

.reinsurance-login-card {
    position: relative;
    width: 100%;
    max-width: 470px;
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(231, 239, 246, 0.94), rgba(217, 229, 239, 0.88));
    border: 1px solid rgba(122, 166, 202, 0.18);
    box-shadow:
        0 34px 80px rgba(60, 101, 144, 0.14),
        0 10px 24px rgba(60, 101, 144, 0.07);
    backdrop-filter: blur(14px);
    overflow: visible;
    animation: fadeUp 0.7s ease;
}

/* stacked register papers behind the card */
.reinsurance-login-card::before,
.reinsurance-login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    z-index: -1;
}

.reinsurance-login-card::before {
    transform: translate(14px, 14px) rotate(-2deg);
    background: rgba(214, 228, 239, 0.78);
    border: 1px solid rgba(130, 173, 207, 0.12);
    box-shadow: 0 18px 35px rgba(74, 112, 149, 0.08);
}

.reinsurance-login-card::after {
    transform: translate(-12px, 12px) rotate(1.6deg);
    background: rgba(206, 222, 235, 0.68);
    border: 1px solid rgba(130, 173, 207, 0.10);
    box-shadow: 0 14px 28px rgba(74, 112, 149, 0.06);
}

/* colored file-tab feel */
.login-card-top::before {
    content: "";
    position: absolute;
    top: -10px;
    right: 42px;
    width: 118px;
    height: 18px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, #7fc9ef 0%, #78aef8 55%, #6fc7be 100%);
    box-shadow: 0 6px 16px rgba(103, 167, 218, 0.14);
}

/* subtle inner ledger lines */
.login-card-body::before {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 22px;
    pointer-events: none;
    background:
        linear-gradient(rgba(108, 151, 186, 0.045) 1px, transparent 1px);
    background-size: 100% 46px;
    opacity: 0.28;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.20), transparent 75%);
}

.login-card-top {
    position: relative;
    padding: 24px 26px 0;
    text-align: left;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4a6985;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.96rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    color: #204d72;
    transform: translateY(-1px);
}

.login-card-body {
    position: relative;
    padding: 24px 34px 34px;
    text-align: center;
}

.login-badge {
    display: inline-block;
    padding: 8px 13px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7fc9ef 0%, #78aef8 55%, #6fc7be 100%);
    border: 1px solid rgba(118, 171, 210, 0.18);
    color: #355c7b;
    font-size: 0.79rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.login-card-body h1 {
    margin: 0 0 10px;
    font-size: 2.15rem;
    line-height: 1.02;
    font-weight: 850;
    letter-spacing: -0.045em;
    color: #183a54;
}

.subtitle {
    margin: 0 auto 24px;
    color: #587691;
    line-height: 1.65;
    font-size: 0.99rem;
    max-width: 320px;
}

/* =========================
   ALERT
   ========================= */

.login-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 237, 237, 0.88);
    border: 1px solid rgba(223, 142, 142, 0.28);
    color: #9f4545;
    font-size: 0.92rem;
    line-height: 1.5;
    box-shadow: 0 6px 14px rgba(181, 96, 96, 0.04);
    text-align: left;
}

/* =========================
   FORM
   ========================= */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-label {
    font-size: 0.94rem;
    font-weight: 700;
    color: #2f526e;
    letter-spacing: -0.01em;
}

.form-control {
    width: 100%;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(122, 167, 202, 0.16);
    background:
        linear-gradient(180deg, rgba(244, 248, 252, 0.94), rgba(229, 238, 246, 0.88));
    color: #15344c;
    font-size: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.62),
        0 6px 14px rgba(106, 153, 196, 0.04);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.form-control::placeholder {
    color: #819bb0;
}

.form-control:hover {
    background:
        linear-gradient(180deg, rgba(248,251,254,0.98), rgba(232,240,247,0.92));
}

.form-control:focus {
    outline: none;
    border-color: rgba(94, 155, 208, 0.42);
    background:
        linear-gradient(180deg, rgba(250,252,255,1), rgba(236,244,250,0.96));
    box-shadow:
        0 0 0 4px rgba(120, 180, 228, 0.16),
        0 10px 22px rgba(101, 153, 197, 0.08);
    transform: translateY(-1px);
}

/* fix ugly browser autofill */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-text-fill-color: #15344c;
    -webkit-box-shadow: 0 0 0 1000px #e4edf4 inset !important;
    box-shadow: 0 0 0 1000px #e4edf4 inset !important;
    transition: background-color 9999s ease-in-out 0s;
    border: 1px solid rgba(122, 167, 202, 0.16);
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: linear-gradient(180deg, #dde9f2, #cfdeea);
    color: #486d8c;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    padding: 8px 11px;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.55),
        0 4px 10px rgba(76, 123, 165, 0.06);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.password-toggle:hover {
    background: linear-gradient(180deg, #e6f0f7, #d5e4ef);
    color: #234c71;
}

/* =========================
   BUTTON
   ========================= */

.btn-login {
    position: relative;
    width: 100%;
    margin-top: 6px;
    padding: 16px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #89ccef 0%, #74aef2 58%, #69c2b9 100%);
    color: #12324b;
    font-weight: 900;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        0 16px 26px rgba(91, 151, 197, 0.22),
        inset 0 1px 0 rgba(255,255,255,0.42);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    overflow: hidden;
}

.btn-login::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.22) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    filter: brightness(1.02);
    box-shadow:
        0 20px 30px rgba(91, 151, 197, 0.26),
        inset 0 1px 0 rgba(255,255,255,0.42);
}

.btn-login:hover::before {
    transform: translateX(120%);
}

.btn-login:disabled {
    cursor: wait;
    opacity: 1;
}

.btn-loader {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(18, 50, 75, 0.18);
    border-top-color: rgba(18, 50, 75, 0.95);
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

.btn-login.is-loading .btn-text {
    opacity: 0;
}

.btn-login.is-loading .btn-loader {
    opacity: 1;
}

/* =========================
   ANIMATIONS
   ========================= */

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

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

@keyframes breathe {
    0%, 100% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.035);
    }
}

@keyframes slowSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}