body.login-page,
body.ic-login-body {
    margin: 0;
    background: #0b1020;
}

.ic-login {
    --p: #4f46e5;
    --p2: #7c3aed;
    --gold: #d9b65e;
    --text: #0f172a;
    --soft: #64748b;
    --muted: #94a3b8;
    --line: #e7ebf3;
    --red: #ef4444;
    --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}
.ic-login *, .ic-login *::before, .ic-login *::after { box-sizing: border-box; }

/* ============================ BRAND PANEL ============================ */
.ic-login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 56px;
    color: #fff;
    background:
        radial-gradient(900px 600px at 85% -10%, rgba(217, 182, 94, .35), transparent 55%),
        radial-gradient(700px 500px at 0% 110%, rgba(124, 58, 237, .5), transparent 55%),
        linear-gradient(135deg, #4f46e5 0%, #6d28d9 48%, #1e1b4b 100%);
}
.ic-login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .08), transparent 12%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, .06), transparent 14%);
    pointer-events: none;
}
.ic-login-brand-inner { position: relative; z-index: 1; max-width: 460px; }

.ic-login-mark {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(6px);
    margin-bottom: 26px;
}
.ic-login-brand h1 {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.5px;
    margin: 0 0 14px;
}
.ic-login-brand p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
    margin: 0 0 30px;
}
.ic-login-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ic-login-feats li {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
}
.ic-login-feats i {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
}
.ic-login-tier {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 34px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 999px;
    color: #2a210a;
    background: linear-gradient(135deg, #fbe6b0, var(--gold));
}

/* ============================ FORM PANEL ============================ */
.ic-login-form-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background:
        radial-gradient(700px 500px at 100% 0%, rgba(79, 70, 229, .06), transparent 55%),
        #eef1f8;
}
.ic-login-card {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 38px 34px;
    box-shadow: 0 30px 70px -35px rgba(15, 23, 42, .45);
}
.ic-login-head { text-align: center; margin-bottom: 26px; }
.ic-login-head .ic-login-mark {
    width: 56px; height: 56px; font-size: 26px; margin: 0 auto 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--p), var(--p2));
    border: none;
    box-shadow: 0 14px 30px -14px rgba(79, 70, 229, .9);
    display: none; /* shown only on mobile */
}
.ic-login-head h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.3px;
}
.ic-login-head p { margin: 0; font-size: 14px; color: var(--soft); line-height: 1.5; }

/* Fields */
.ic-form-group { margin-bottom: 16px; }
.ic-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #f6f8fc;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.ic-field:focus-within {
    border-color: var(--p);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.ic-field-ico {
    flex: 0 0 auto;
    width: 48px;
    text-align: center;
    font-size: 18px;
    color: var(--muted);
}
.ic-field:focus-within .ic-field-ico { color: var(--p); }
.ic-field .ic-input,
.ic-field input {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 14px 14px 0;
    font-size: 15px;
    font-family: var(--font);
    font-weight: 600;
    color: var(--text);
}
.ic-field input::placeholder { color: var(--muted); font-weight: 500; }
.ic-eye {
    flex: 0 0 auto;
    width: 46px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    transition: color .15s ease;
}
.ic-eye:hover { color: var(--p); }

.ic-form-group .help-block,
.ic-login .help-block {
    color: var(--red);
    font-size: 12.5px;
    font-weight: 600;
    margin: 7px 4px 0;
}
.ic-field.has-error,
.ic-form-group.has-error .ic-field { border-color: var(--red); }
.ic-form-group.has-error .ic-field:focus-within { box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }

/* Remember + actions row */
.ic-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 2px 20px;
}
.ic-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.ic-check input { position: absolute; opacity: 0; pointer-events: none; }
.ic-check-box {
    width: 20px; height: 20px;
    border-radius: 7px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    transition: .15s ease;
}
.ic-check-box::after { content: "\2713"; opacity: 0; font-weight: 900; }
.ic-check input:checked + .ic-check-box {
    background: linear-gradient(135deg, var(--p), var(--p2));
    border-color: transparent;
}
.ic-check input:checked + .ic-check-box::after { opacity: 1; }
.ic-check-label { font-size: 14px; font-weight: 600; color: var(--soft); }

/* Submit */
.ic-login-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    background: linear-gradient(135deg, var(--p), var(--p2));
    box-shadow: 0 18px 34px -16px rgba(79, 70, 229, .95);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.ic-login-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.ic-login-btn:active { transform: translateY(0); }

/* Global error alert */
.ic-login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fdeaea;
    color: #9b1c1c;
    border: 1px solid #f6c9c9;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
}
.ic-login-alert i { font-size: 17px; margin-top: 1px; }

.ic-login-foot {
    margin-top: 24px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

/* ============================ TABLET ============================ */
@media (max-width: 1024px) {
    .ic-login-brand { padding: 44px; }
    .ic-login-form-wrap { padding: 40px 28px; }
}

/* ============================ PHONE (app shell) ============================ */
@media (max-width: 640px) {
    .ic-login {
        display: block;
        min-height: 100vh;
        background: linear-gradient(160deg, #4f46e5 0%, #6d28d9 52%, #1e1b4b 100%);
    }

    /* Brand becomes a compact gradient hero on top */
    .ic-login-brand {
        min-height: 38vh;
        padding: calc(40px + env(safe-area-inset-top, 0px)) 28px 64px;
        align-items: flex-end;
        background:
            radial-gradient(600px 400px at 90% -10%, rgba(217, 182, 94, .35), transparent 55%),
            linear-gradient(160deg, #4f46e5 0%, #6d28d9 52%, #1e1b4b 100%);
    }
    .ic-login-brand-inner { max-width: none; }
    .ic-login-mark { width: 54px; height: 54px; font-size: 26px; margin-bottom: 18px; }
    .ic-login-brand h1 { font-size: 26px; margin-bottom: 8px; }
    .ic-login-brand p { font-size: 14px; margin-bottom: 0; }
    .ic-login-feats,
    .ic-login-tier { display: none; }

    /* Form rises as a white sheet */
    .ic-login-form-wrap {
        background: transparent;
        padding: 0;
        margin-top: -34px;
        align-items: stretch;
    }
    .ic-login-card {
        max-width: none;
        border: none;
        border-radius: 28px 28px 0 0;
        padding: 30px 22px calc(34px + env(safe-area-inset-bottom, 0px));
        min-height: 62vh;
        box-shadow: 0 -10px 40px -20px rgba(0, 0, 0, .35);
    }
    .ic-login-head { text-align: center; margin-bottom: 24px; }
    .ic-login-head .ic-login-mark { display: inline-flex; }
}

/* ============================ DARK (system) ============================ */
@media (prefers-color-scheme: dark) {
    .ic-login-form-wrap { background: #0b1020; }
    .ic-login-card { background: #131a2c; border-color: #243049; color: #e8ecf6; }
    .ic-login-head h2 { color: #e8ecf6; }
    .ic-field { background: #0f1626; border-color: #243049; }
    .ic-field:focus-within { background: #131a2c; }
    .ic-field .ic-input, .ic-field input { color: #e8ecf6; }
    @media (max-width: 640px) { .ic-login-form-wrap { background: transparent; } }
}
