/* ============================================================
   Ricochet360 — Login v2
   Glassmorphism card + physics-canvas background ("Chamber").
   Shared across login, forgot-password, reset-password, 2FA.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --rc-bg-deep: #070f1b;
    --rc-bg-mid: #0f1d34;
    --rc-bg-glow: #1a3358;
    --rc-accent: #f18504;
    --rc-accent-strong: #ff9a1f;
    --rc-accent-blue: #4a90ff;
    --rc-text: #ffffff;
    --rc-text-muted: rgba(255, 255, 255, 0.68);
    --rc-text-faint: rgba(255, 255, 255, 0.42);
    --rc-card-bg: rgba(11, 22, 40, 0.94);
    --rc-card-border: rgba(255, 255, 255, 0.08);
    --rc-card-border-strong: rgba(255, 255, 255, 0.18);
    --rc-field-bg: rgba(8, 18, 34, 0.55);
    --rc-field-border: rgba(255, 255, 255, 0.1);
    --rc-field-border-focus: rgba(241, 133, 4, 0.55);
    --rc-error: #ff8a8a;
    --rc-success: #7be7a1;
    --rc-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.55), 0 4px 12px -2px rgba(0, 0, 0, 0.35);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(ellipse at 50% 40%, var(--rc-bg-glow) 0%, var(--rc-bg-mid) 35%, var(--rc-bg-deep) 100%) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--rc-text);
    overflow: hidden;
}

/* Kill legacy chrome from the old layout */
.navbar.navbar-fixed-top { display: none !important; }
#wrap { height: 100% !important; padding: 0 !important; margin: 0 !important; }
.rc-login-page .container { padding: 0 !important; max-width: none !important; width: 100% !important; }

/* ---------- Stage ---------- */
.rc-login-page {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
}

.rc-chamber {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    pointer-events: none;
}

.rc-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 24px;
    box-sizing: border-box;
}

/* ---------- Card ---------- */
.rc-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 44px 40px 36px;
    border-radius: 22px;
    background: var(--rc-card-bg);
    border: 1px solid var(--rc-card-border);
    box-shadow: var(--rc-shadow);
    transform: translate3d(0, 0, 0);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
    will-change: transform;
    /* isolation prevents any descendant blend mode from bleeding onto the
       canvas behind the card. */
    isolation: isolate;
}

/* ---------- Logo ---------- */
.rc-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    height: 52px;
}
.rc-logo img {
    max-height: 44px;
    max-width: 80%;
    filter: drop-shadow(0 2px 10px rgba(241, 133, 4, 0.28));
}
.rc-logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.rc-title {
    margin: 6px 0 4px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--rc-text);
}
.rc-subtitle {
    margin: 0 0 26px;
    text-align: center;
    font-size: 14px;
    color: var(--rc-text-muted);
}

/* ---------- Flash messages ---------- */
.rc-flash {
    margin: -10px 0 18px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    border: 1px solid transparent;
}
.rc-flash.is-error {
    color: var(--rc-error);
    background: rgba(255, 138, 138, 0.08);
    border-color: rgba(255, 138, 138, 0.25);
}
.rc-flash.is-success {
    color: var(--rc-success);
    background: rgba(123, 231, 161, 0.08);
    border-color: rgba(123, 231, 161, 0.25);
}

/* ---------- Form fields ---------- */
.rc-form { margin: 0; padding: 0; }

.rc-field {
    position: relative;
    margin-bottom: 14px;
}

.rc-field .rc-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--rc-text-faint);
    pointer-events: none;
    transition: color 0.2s ease;
}

.rc-field input,
.rc-field .form-control,
.rc-form input.form-control {
    width: 100% !important;
    height: 52px !important;
    padding: 0 44px 0 46px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: var(--rc-field-bg) !important;
    border: 1px solid var(--rc-field-border) !important;
    border-radius: 12px !important;
    color: var(--rc-text) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: 52px;
    display: block;
    text-transform: none;
}

.rc-field input::placeholder,
.rc-field .form-control::placeholder { color: var(--rc-text-faint); opacity: 1; }

.rc-field input:focus,
.rc-field .form-control:focus {
    border-color: var(--rc-field-border-focus);
    background: rgba(8, 18, 34, 0.75);
    box-shadow: 0 0 0 4px rgba(241, 133, 4, 0.1);
}

.rc-field:focus-within .rc-field-icon { color: var(--rc-accent); }

/* Animated underline that "charges" on focus */
.rc-field::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--rc-accent), var(--rc-accent-blue));
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
}
.rc-field:focus-within::after { transform: scaleX(1); opacity: 0.75; }

/*
 * Autofill override.
 *
 * Chrome / Safari / Edge paint saved-credential inputs with their own
 * white (Chrome) or yellow (older Safari) autofill background that
 * stomps our dark theme, leaving nearly-unreadable dark text on a
 * white field. Setting `background-color` directly does NOT work --
 * browsers intentionally ignore it for autofilled inputs. The
 * workaround is the 1000px inset box-shadow trick below: paint our
 * dark theme color as a shadow that fills the input, masking the
 * browser's autofill fill.
 *
 * Covers all four pseudo-states the browser cycles through (rest /
 * hover / focus / active) plus the newer standardized `:autofill`,
 * with `!important` so later cascade entries (including browser
 * user-agent styles) cannot win. Scoped to .rc-login-page so it can
 * only touch the login / 2FA / forgot-password / reset-password
 * screens -- no other part of the app loads login-v2.css.
 */
.rc-login-page .rc-field input:-webkit-autofill,
.rc-login-page .rc-field input:-webkit-autofill:hover,
.rc-login-page .rc-field input:-webkit-autofill:focus,
.rc-login-page .rc-field input:-webkit-autofill:active,
.rc-login-page .rc-field input:-internal-autofill-selected,
.rc-login-page .rc-field input:-internal-autofill-previewed,
.rc-login-page .rc-field input:autofill,
.rc-login-page .rc-field input:autofill:hover,
.rc-login-page .rc-field input:autofill:focus,
.rc-login-page .rc-field input:autofill:active {
    -webkit-text-fill-color: var(--rc-text) !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(8, 18, 34, 0.95) inset !important;
    box-shadow: 0 0 0 1000px rgba(8, 18, 34, 0.95) inset !important;
    caret-color: var(--rc-text) !important;
    transition: background-color 99999s ease-in-out 0s !important;
}

/* Password visibility toggle */
.rc-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--rc-text-faint);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    padding: 0;
}
.rc-eye:hover { color: var(--rc-text); background: rgba(255, 255, 255, 0.05); }
.rc-eye:focus { outline: 2px solid var(--rc-field-border-focus); outline-offset: 2px; }
.rc-eye i { font-size: 14px; }

/* ---------- Submit button ---------- */
.rc-submit,
input[type="submit"].rc-submit,
button.rc-submit,
.rc-form .rc-submit {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    margin: 8px 0 0 0 !important;
    padding: 0 16px !important;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--rc-accent) 0%, var(--rc-accent-strong) 100%) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    cursor: pointer !important;
    overflow: hidden !important;
    box-shadow: 0 10px 24px -8px rgba(241, 133, 4, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-indent: 0 !important;
    line-height: 52px !important;
    text-align: center !important;
}
.rc-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px -8px rgba(241, 133, 4, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.05);
}
.rc-submit:active { transform: translateY(0); filter: brightness(0.97); }
.rc-submit:focus { outline: 2px solid rgba(241, 133, 4, 0.6); outline-offset: 3px; }

/* Shimmer sweep */
.rc-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: rc-shimmer 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes rc-shimmer {
    0%, 70% { left: -60%; }
    100% { left: 130%; }
}

.rc-card.is-whitelabel .rc-submit {
    background: linear-gradient(135deg, #4a90ff 0%, #6ea8ff 100%);
    box-shadow: 0 10px 24px -8px rgba(74, 144, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.rc-card.is-whitelabel .rc-submit:hover {
    box-shadow: 0 14px 32px -8px rgba(74, 144, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---------- Secondary links ---------- */
.rc-forgot {
    display: block;
    margin: 18px auto 0;
    max-width: 320px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rc-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.rc-forgot:hover { color: var(--rc-text); text-decoration: none; }

.rc-hint {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--rc-text-muted);
    text-align: center;
}
.rc-hint strong { color: var(--rc-text); font-weight: 600; }

.rc-meta-link {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: var(--rc-text-muted);
    text-decoration: none;
}
.rc-meta-link:hover { color: var(--rc-text); text-decoration: underline; }

/* ---------- Browser support footer ---------- */
.rc-browser {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rc-text-faint);
    z-index: 2;
}
.rc-browser img { height: 16px; margin-left: 6px; vertical-align: middle; opacity: 0.75; }

/* ---------- Submit-success converge animation ---------- */
.rc-card.is-leaving {
    animation: rc-card-depart 0.55s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}
@keyframes rc-card-depart {
    to {
        transform: scale(0.96) translateY(-6px);
        opacity: 0;
        filter: blur(4px);
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .rc-submit::before { animation: none; display: none; }
    .rc-field::after { transition: none; }
    .rc-card.is-leaving { animation: none; opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .rc-card { padding: 34px 24px 28px; max-width: 92vw; border-radius: 18px; }
    .rc-title { font-size: 19px; }
    .rc-logo { height: 44px; margin-bottom: 14px; }
    .rc-logo img { max-height: 36px; }
    .rc-browser { font-size: 10px; }
}

@media (max-height: 620px) {
    .rc-card { padding: 30px 32px 26px; }
    .rc-subtitle { margin-bottom: 18px; }
    .rc-browser { display: none; }
}
