/* public/assets/css/auth-theme.css */

/* Corner-radius scale — same values as admin-theme.css (the login pages
   don't load that file). Keep the two in sync. */
:root {
    --radius-control: 10px;
    --radius-icon: 8px;
    --radius-card: 16px;
    --radius-pill: 999px;

    /* Primary button colors: same values as admin-theme.css. */
    --btn-bg: #71AA60;
    --btn-bg-hover: #5F9850;
    --btn-bg-active: #4F8542;
    --btn-text: #FFFFFF;
    --btn-font-weight: 500; /* Medium */
    /* Keyboard focus outline everywhere (Deep Olive, ~11:1 on white). */
    --focus-ring: #2C3A1E;
    --btn-focus-ring: var(--focus-ring);
    --btn-disabled-bg: #E8E5DC;
    --btn-disabled-text: #8A8D7E;
}

body.auth-body {
    background: #f0ede6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}
.auth-frame {
    background: #fff;
    border: 1px solid #333;
    border-radius: var(--radius-card);
    padding: 2rem;
    max-width: 900px;
    width: 100%;
}
.auth-card {
    background: #efe9df;
    border-radius: var(--radius-card);
    padding: 2.5rem;
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/assets/img/RfourL_Logo.jpg') center/65% no-repeat;
    opacity: 0.1;
    filter: grayscale(1);
    pointer-events: none;
}
.auth-card h2 { text-align: center; font-weight: 700; margin-bottom: 2rem; }
.auth-card label { font-size: 0.85rem; margin-bottom: 0.25rem; display: block; }
.auth-card input {
    width: 100%; padding: 0.6rem 0.75rem; margin-bottom: 1rem;
    border: 1px solid #ccc; border-radius: var(--radius-control); background: #fff;
}
.auth-card .forgot-link { text-align: right; font-size: 0.8rem; margin-top: -0.5rem; margin-bottom: 1rem; }
.btn-login {
    width: 100%; background: var(--btn-bg); color: var(--btn-text); border: none;
    padding: 0.8rem; border-radius: var(--radius-control); font-weight: var(--btn-font-weight);
    display: flex; align-items: center; justify-content: center; gap: 0;
    cursor: pointer;
    /* Same effect as the app's primary buttons (admin-theme.css "Motion polish"). */
    transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, gap 0.2s ease;
}
.btn-login .btn-login-arrow {
    display: inline-block;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, width 0.2s ease, transform 0.2s ease, margin-left 0.2s ease;
}
.btn-login:hover:not(:disabled),
.btn-login:focus-visible:not(:disabled) { background: var(--btn-bg-hover); gap: 6px; }
.btn-login:hover:not(:disabled) { transform: translateY(-1px); }
.btn-login:hover:not(:disabled) .btn-login-arrow,
.btn-login:focus-visible:not(:disabled) .btn-login-arrow {
    opacity: 0.9;
    width: 0.9em;
    transform: translateX(0);
    margin-left: 0;
}
.btn-login:active:not(:disabled) { background: var(--btn-bg-active); transform: translateY(0); }
.btn-login:focus-visible { outline: 3px solid var(--btn-focus-ring); outline-offset: 2px; }
.btn-login:disabled { background: var(--btn-disabled-bg); color: var(--btn-disabled-text); cursor: not-allowed; }
.auth-error { color: #a33; text-align: center; font-size: 0.85rem; margin-top: 1rem; }
.auth-success { color: #2f6431; text-align: center; font-size: 0.85rem; margin-top: 1rem; }
.auth-notice {
    background: #fdf3d6; border: 1px solid #e6cf8a; color: #6b5510;
    border-radius: var(--radius-control); padding: 0.6rem 0.8rem; font-size: 0.85rem; text-align: center; margin-bottom: 1rem;
}
.auth-hint { text-align: center; font-size: 0.85rem; color: #555; margin-bottom: 1.5rem; }
.otp-boxes { display: flex; justify-content: center; gap: 0.6rem; margin: 1.5rem 0; }
.otp-boxes input {
    width: 3rem; height: 3.4rem; text-align: center; font-size: 1.4rem; font-weight: 700;
    border: 1px solid #ccc; border-radius: var(--radius-control); background: #fff;
}
.auth-resend { text-align: center; font-size: 0.85rem; margin-top: 1rem; }
.auth-resend button { border: none; background: none; color: #4a7a3a; font-weight: 700; cursor: pointer; padding: 0; }
.auth-back { text-align: center; font-size: 0.8rem; margin-top: 1rem; }
.auth-back a { color: #666; }
.role-select-card {
    background: #efe9df; border-radius: var(--radius-card); padding: 2rem;
    max-width: 320px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem;
}
/* Sign-in page — full-screen sliding split layout */
html, body.landing-body {
    height: 100%;
}

.landing-body {
    margin: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

.landing-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}

.dark-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 2;
    box-sizing: border-box;
    color: #fff;
    background-image: linear-gradient(rgba(44, 58, 30, 0.82), rgba(44, 58, 30, 0.82)), url('/assets/img/landing-shop-bg.jpg');
    background-size: cover;
    background-position: center bottom;
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.dark-panel.slid {
    transform: translateX(100%);
}

.content-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
    box-sizing: border-box;
    background: #fff;
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.content-panel.slid {
    transform: translateX(-100%);
}

.no-transition {
    transition: none !important;
}

/* Crossfade: views in a panel stack on top of each other (so the layout
   doesn't jump) and fade between each other instead of an instant swap.
   The side being covered fades out quickly; the side being revealed
   fades in a bit slower, after a short delay, so it appears once the
   panel has mostly slid into place rather than mid-slide. visibility is
   included in the transition (at 0 duration, timed to the relevant edge)
   so hidden content can't be tabbed into. */
.panel-content {
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    max-width: 480px;
    margin: 0 auto;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.panel-content.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease 0.32s, visibility 0s linear 0.32s;
}

.dark-view {
    position: absolute;
    top: 50%;
    left: 80px;
    right: 40px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.dark-view.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease 0.32s, visibility 0s linear 0.32s;
}

.panel-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: #1c1c1c;
}

.landing-logo-box {
    width: 130px;
    height: 130px;
    background: #F4F4F4;
    border-radius: var(--radius-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 28px;
}

.landing-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.landing-brand h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 14px;
}

.landing-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px; /* one line; balance (below) only kicks in on narrow screens */
    margin: 0;
}

.landing-footer-line {
    position: absolute;
    left: 80px;
    bottom: 40px;
    font-size: 13px;
    color: #B9C4AD;
}

.landing-subtitle {
    color: #666;
    margin: 0 0 28px;
}

.role-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.role-card {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid #e2e0d8;
    border-radius: var(--radius-card);
    background: none;
    font: inherit;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.role-card:hover {
    border-color: #4b6a3f;
    background: #eef5ea;
}

.role-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: var(--radius-icon);
    background: #e9f1e4;
    color: #4b6a3f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.role-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-text strong {
    font-size: 1.05rem;
    color: #1c1c1c;
}

.role-text span {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.role-arrow {
    color: #999;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.role-card:hover .role-arrow {
    color: #4b6a3f;
}

.back-to-roles {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
}

.back-to-roles:hover {
    color: #4b6a3f;
}

.landing-logo-box-sm {
    width: 90px;
    height: 90px;
    margin-bottom: 24px;
}

.signing-in-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #B9C4AD;
    margin-bottom: 6px;
}

.signing-in-role {
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 14px;
}

.signing-in-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 560px; /* each role description fits on one line; balance (below) only kicks in on narrow screens */
    margin: 0 0 28px;
}

/* Login form views */
.login-form-view label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    display: block;
    color: #444;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e9f1e4;
    color: #355e3b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
}

.form-subtitle {
    color: #666;
    margin: 0 0 28px;
}

.field-group {
    margin-bottom: 18px;
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrap > i {
    position: absolute;
    left: 14px;
    color: #999;
    font-size: 1rem;
    pointer-events: none;
}

.input-icon-wrap input {
    width: 100%;
    padding: 0.75rem 0.85rem 0.75rem 2.6rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-control);
    background: #fff;
    box-sizing: border-box;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.pw-toggle:hover {
    color: #4b6a3f;
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 4px 0 20px;
}

.forgot-link-inline {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1c1c1c;
}

.forgot-link-inline:hover {
    color: #4b6a3f;
}
/* Hide the browser's built-in password reveal/clear buttons (Edge/IE) —
   the password field already has its own eye toggle. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* ===== Login pages: app fonts and form typography =====
   Poppins throughout (each page loads it). Controls don't inherit fonts by default. */
.landing-body button,
.landing-body input,
.landing-body select,
.landing-body textarea,
.auth-body button,
.auth-body input,
.auth-body select,
.auth-body textarea { font-family: inherit; }

/* Big titles: same as the app's page titles (e.g. "Inventory"): Poppins 800, -0.02em. */
.landing-brand h1,
.panel-content h2,
.signing-in-role { font-family: 'Poppins', 'Segoe UI', sans-serif; font-weight: 800; letter-spacing: -0.02em; }

/* No lonely last word in the photo-panel descriptions. */
.landing-tagline,
.signing-in-desc { text-wrap: balance; }

/* Sign in: Poppins 16px semibold, white; same 41px height as before. */
.landing-body .btn-login,
.auth-body .btn-login {
    font-size: 16px; font-weight: 600; color: #fff;
    height: 41px; padding-top: 0; padding-bottom: 0; line-height: 1;
}

/* Labels: 14px semibold, 7px above the input. */
.login-form-view label { font-size: 14px; font-weight: 600; color: #1F2617; margin-bottom: 7px; }

/* Inputs: Poppins 15px; stay white when the browser autofills them. */
.input-icon-wrap input { font-size: 15px; color: #1F2617; height: 41px; padding-top: 0; padding-bottom: 0; } /* same 41px as before */
.input-icon-wrap input:-webkit-autofill,
.input-icon-wrap input:-webkit-autofill:hover,
.input-icon-wrap input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: #1F2617;
    caret-color: #1F2617;
    transition: background-color 9999s ease-out 0s;
}
.input-icon-wrap input:-webkit-autofill::first-line,
.auth-card input:-webkit-autofill::first-line { font-family: 'Poppins', 'Segoe UI', sans-serif; font-size: 15px; }

/* Forgot password?: 14px medium, green, underline only on hover / keyboard focus. */
.forgot-link-inline { font-size: 14px; font-weight: 500; color: #4A6741; text-decoration: none; }
.forgot-link-inline:hover,
.forgot-link-inline:focus-visible { color: #4A6741; text-decoration: underline; }

/* ===== Forgot password / Code verification / Reset password (and Staff "Can't access") =====
   Same typography as the sign-in pages. Sizes stay as before (inputs 36px, button 41px). */
.auth-card h2 { font-family: 'Poppins', 'Segoe UI', sans-serif; font-weight: 800; letter-spacing: -0.02em; color: #1c1c1c; }
.auth-card label { font-size: 14px; font-weight: 600; color: #1F2617; margin-bottom: 7px; }
/* Inputs fill the card's inner width exactly (padding and border counted inside), 41px tall like
   the sign-in pages. */
.auth-card input { font-size: 15px; color: #1F2617; box-sizing: border-box; width: 100%; height: 41px; padding-top: 0; padding-bottom: 0; }
/* All password-flow cards share the Forgot password card's width: 420px content + 40px padding
   each side = 500px (narrower only on very small screens). */
.auth-body .auth-card { width: 420px; max-width: calc(100vw - 112px); }
.auth-back a,
.auth-resend button { font-size: 14px; font-weight: 500; color: #4A6741; text-decoration: none; }
.auth-back a:hover,
.auth-back a:focus-visible,
.auth-resend button:hover,
.auth-resend button:focus-visible { color: #4A6741; text-decoration: underline; }
