/* ---------------------------------------------------------------------------
   RC Info Solutions - shared login screen.

   Used by three sign-in pages that must read as one system:
       admin/index.cshtml         Admin Panel
       registration/index.cshtml  Candidate Portal
       department/index.cshtml    Department Portal

   Each page sets a role label; everything else is identical. Palette and
   geometry follow the brand banner - black and #eb1c24 on white, with
   diagonal slabs cutting across the panel.

   Load AFTER the theme CSS so these rules win.
   --------------------------------------------------------------------------- */

:root {
    --rc-red: #eb1c24;
    --rc-red-dark: #c1141b;
    --rc-black: #111214;
    --rc-charcoal: #1c1f24;
    --rc-slate: #6b7280;
    --rc-line: #e2e5ea;
    --rc-ground: #f4f5f7;
    --rc-white: #ffffff;

    --rc-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rc-auth * {
    box-sizing: border-box;
}

/* The login screens fill the viewport exactly and never scroll the page.
   body is a flex column so the mobile brand strip (a sibling of .rc-auth)
   takes its natural height and .rc-auth absorbs the rest. On a short screen
   the form column scrolls inside itself rather than the whole page.
   This stylesheet is loaded only by the three sign-in pages. */
html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* SweetAlert2 puts height:auto !important on body while a dialog is open,
   which would collapse this full-height flex layout behind the dialog. */
body.swal2-height-auto {
    height: 100% !important;
}

.rc-auth {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    font-family: var(--rc-sans);
    background: var(--rc-ground);
    overflow: hidden;
}

/* ---------------- brand panel ---------------- */

.rc-brand {
    position: relative;
    overflow: hidden;
    min-height: 0;
    background: var(--rc-black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 56px;
    color: #fff;
}

/* Diagonal slabs, echoing the corner cuts on the brand banner. */
.rc-brand::before,
.rc-brand::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.rc-brand::before {
    top: -12%;
    left: -18%;
    width: 46%;
    height: 130%;
    background: var(--rc-red);
    transform: skewX(-12deg);
    opacity: .95;
}

.rc-brand::after {
    top: -20%;
    left: -4%;
    width: 30%;
    height: 145%;
    background: var(--rc-charcoal);
    transform: skewX(-12deg);
}

.rc-brand-inner {
    position: relative;
    z-index: 2;
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.rc-logo {
    max-width: 260px;
    max-height: 96px;
    height: auto;
    border-radius: 15px;
    display: block;
    background: white;
    padding: 20px;
    margin-bottom: 26px;
}

.rc-wordmark {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.05;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.rc-rule {
    width: 100%;
    height: 3px;
    background: var(--rc-red);
    margin: 0 0 14px;
    border: none;
}

.rc-tagline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #e7e9ee;
    margin: 0 0 26px;
}

    .rc-tagline span[aria-hidden] {
        color: var(--rc-red);
        font-weight: 400;
    }

.rc-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

    .rc-points li {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: .76rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #c9ced8;
    }

    .rc-points i {
        flex: none;
        width: 30px;
        height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 15px;
        color: #fff;
        background: var(--rc-red);
    }

        .rc-points li:nth-child(even) i {
            background: var(--rc-charcoal);
            border: 1px solid #3a3f47;
        }

/* ---------------- form side ---------------- */

.rc-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
    background: var(--rc-ground);
    position: relative;
    min-height: 0;
    overflow-y: auto;   /* only this column scrolls, and only when it must */
}

    /* Faint diagonal wash so the white side is not flat. */
    .rc-form-side::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(115deg, rgba(235, 28, 36, .05) 0 22%, transparent 22%),
            linear-gradient(295deg, rgba(17, 18, 20, .04) 0 18%, transparent 18%);
        pointer-events: none;
    }

.rc-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 27rem;
    margin: auto;   /* stays centred, but can grow past centre if space is tight */
    background: var(--rc-white);
    border: 1px solid var(--rc-line);
    border-radius: 10px;
    padding: 32px 34px;
    box-shadow: 0 18px 50px rgba(17, 18, 20, .09);
}

.rc-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--rc-red);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 6px 13px;
    border-radius: 3px;
    margin-bottom: 18px;
}

.rc-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--rc-black);
    margin: 0 0 6px;
}

.rc-card .rc-sub {
    color: var(--rc-slate);
    font-size: .92rem;
    margin: 0 0 22px;
}

.rc-field {
    margin-bottom: 15px;
}

    .rc-field label {
        display: block;
        font-size: .74rem;
        font-weight: 700;
        letter-spacing: .09em;
        text-transform: uppercase;
        color: var(--rc-charcoal);
        margin-bottom: 7px;
    }

.rc-input-wrap {
    position: relative;
}

.rc-auth .rc-input {
    width: 100%;
    height: 50px;
    border: 1.5px solid var(--rc-line);
    border-radius: 6px;
    padding: 0 16px;
    font-size: .95rem;
    color: var(--rc-black);
    background: #fbfbfc;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

    .rc-auth .rc-input:hover {
        border-color: #c9cdd4;
    }

    .rc-auth .rc-input:focus {
        outline: none;
        background: #fff;
        border-color: var(--rc-red);
        box-shadow: 0 0 0 3px rgba(235, 28, 36, .13);
    }

    .rc-auth .rc-input::placeholder {
        color: #a4aab4;
    }

.rc-input-pass {
    padding-right: 48px;
}

.rc-eye {
    position: absolute;
    top: 0;
    right: 0;
    height: 50px;
    width: 46px;
    border: none;
    background: transparent;
    color: var(--rc-slate);
    cursor: pointer;
    font-size: 17px;
    border-radius: 0 6px 6px 0;
}

    .rc-eye:hover { color: var(--rc-red); }

    .rc-eye:focus-visible {
        outline: 2px solid var(--rc-red);
        outline-offset: -2px;
    }

.rc-auth .rc-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 6px;
    background: var(--rc-red);
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    transition: background .15s ease, transform .08s ease;
}

    .rc-auth .rc-btn:hover { background: var(--rc-red-dark); }
    .rc-auth .rc-btn:active { transform: translateY(1px); }

    .rc-auth .rc-btn:disabled {
        background: #b9bec7;
        cursor: not-allowed;
        transform: none;
    }

    .rc-auth .rc-btn:focus-visible {
        outline: 3px solid rgba(235, 28, 36, .35);
        outline-offset: 2px;
    }

.rc-note {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--rc-line);
    font-size: .82rem;
    color: var(--rc-slate);
    text-align: center;
}

    .rc-note a {
        color: var(--rc-red);
        font-weight: 600;
        text-decoration: none;
    }

        .rc-note a:hover { text-decoration: underline; }

.rc-foot {
    text-align: center;
    font-size: .76rem;
    color: #9aa1ac;
    margin-top: 20px;
    margin-bottom: 0;
}

/* Mobile brand strip, hidden on desktop where the full panel shows. */
.rc-mobile-brand {
    display: none;
    flex: none;
    background: var(--rc-black);
    padding: 16px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .rc-mobile-brand::before {
        content: "";
        position: absolute;
        top: -30%;
        left: -25%;
        width: 45%;
        height: 160%;
        background: var(--rc-red);
        transform: skewX(-12deg);
    }

    .rc-mobile-brand img {
        position: relative;
        z-index: 2;
        max-height: 52px;
        max-width: 200px;
        height: auto;
    }

/* ---------------- responsive ---------------- */

@media (max-width: 991.98px) {
    .rc-auth {
        grid-template-columns: 1fr;
    }

    .rc-brand { display: none; }
    .rc-mobile-brand { display: block; }

    /* The strip is a flex sibling above .rc-auth, so the form column already
       gets exactly the remaining height - no viewport arithmetic needed. */
    .rc-form-side {
        padding: 22px 16px;
    }

    .rc-card {
        padding: 28px 22px;
    }
}

/* Very short viewports (small laptops, landscape phones): drop the panel
   decoration down to what still reads, and let the card breathe less. */
@media (max-height: 640px) {
    .rc-brand { padding: 24px 40px; }
    .rc-logo { max-height: 68px; margin-bottom: 16px; }
    .rc-points { display: none; }
    .rc-tagline { margin-bottom: 0; }

    .rc-card { padding: 24px 26px; }
    .rc-card .rc-sub { margin-bottom: 16px; }
    .rc-field { margin-bottom: 12px; }
    .rc-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rc-auth * {
        transition: none !important;
    }
}
