/*
 * VidzBill Custom Login — login page styles
 *
 * Kept scoped with a .vcl- prefix so it can't collide with a theme's
 * global reset or admin-facing CSS from other plugins. --vcl-brand is
 * inlined by the template so a site can change the accent by tweaking
 * VCL_DEFAULT_BRAND_COLOR (or overriding it via a filter later).
 *
 * Palette: primary = the deep navy from the Vidzbill wordmark.
 *          accent  = the green from "bill" — used sparingly (focus rings,
 *          links, success states) so the brand stays disciplined.
 */

:root {
    --vcl-brand: #141B5C;
    --vcl-brand-dark: #0D1244;
    --vcl-brand-tint: rgba(20, 27, 92, 0.06);
    --vcl-accent: #3EBB6B;
    --vcl-accent-tint: rgba(62, 187, 107, 0.18);
    --vcl-text: #1c1f2a;
    --vcl-muted: #6b7280;
    --vcl-muted-soft: #9aa1ac;
    --vcl-border: #e5e7eb;
    --vcl-border-strong: #d1d5db;
    --vcl-danger: #b3261e;
    --vcl-danger-bg: #fdecec;
    --vcl-warn: #92590a;
    --vcl-warn-bg: #fff4d6;
    --vcl-success: #14713a;
    --vcl-success-bg: #e6f6ec;
    --vcl-info: #1e4479;
    --vcl-info-bg: #eaf1fb;
    --vcl-bg: #f5f6fa;
    --vcl-card: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

.vcl-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--vcl-text);
    background: var(--vcl-bg);
    /* Subtle diagonal gradient — brand tint only, keeps the page calm. */
    background-image:
        radial-gradient(1200px 400px at 15% -10%, var(--vcl-brand-tint), transparent 60%),
        radial-gradient(900px  400px at 110% 110%, var(--vcl-brand-tint), transparent 60%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vcl-shell {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.vcl-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--vcl-card);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.08);
    padding: 24px 26px 22px;
}

/*--------------------------------------------------------------
 * Brand
 *------------------------------------------------------------*/
.vcl-brand {
    text-align: center;
    margin-bottom: 12px;
}
.vcl-logo {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.vcl-wordmark {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--vcl-brand);
}

.vcl-title {
    font-size: 22px;
    font-weight: 700;
    margin: 2px 0 2px;
    text-align: center;
}
.vcl-subtitle {
    font-size: 13px;
    color: var(--vcl-muted);
    margin: 0 0 14px;
    text-align: center;
}

/*--------------------------------------------------------------
 * Alerts
 *------------------------------------------------------------*/
.vcl-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.vcl-alert-error {
    background: var(--vcl-danger-bg);
    color: var(--vcl-danger);
    border: 1px solid rgba(179, 38, 30, 0.15);
}
.vcl-alert-warn {
    background: var(--vcl-warn-bg);
    color: var(--vcl-warn);
    border: 1px solid rgba(146, 89, 10, 0.15);
}
.vcl-alert-success {
    background: var(--vcl-success-bg);
    color: var(--vcl-success);
    border: 1px solid rgba(20, 113, 58, 0.18);
}
.vcl-alert-info {
    background: var(--vcl-info-bg);
    color: var(--vcl-info);
    border: 1px solid rgba(30, 68, 121, 0.15);
}
.vcl-alert-icon {
    flex: 0 0 auto;
    margin-top: 1px;
}

/*--------------------------------------------------------------
 * Form
 *------------------------------------------------------------*/
.vcl-form { display: flex; flex-direction: column; gap: 12px; }

.vcl-field { display: flex; flex-direction: column; gap: 5px; }
.vcl-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--vcl-muted);
    letter-spacing: 0.2px;
}

/* Uniform sizing so the password wrapper doesn't drift out of alignment
 * with the username input — same padding, same height, same border. */
.vcl-form input[type="text"],
.vcl-form input[type="email"],
.vcl-form input[type="password"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 15px;
    line-height: 1.2;
    color: var(--vcl-text);
    background: #fff;
    border: 1px solid var(--vcl-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.vcl-form input[type="text"]:hover,
.vcl-form input[type="email"]:hover,
.vcl-form input[type="password"]:hover {
    border-color: var(--vcl-border-strong);
}
/* Softer focus ring — reads as "active", not "errored/highlighted". */
.vcl-form input[type="text"]:focus,
.vcl-form input[type="email"]:focus,
.vcl-form input[type="password"]:focus {
    border-color: var(--vcl-brand);
    box-shadow: 0 0 0 2px var(--vcl-brand-tint);
}
.vcl-form input::placeholder { color: var(--vcl-muted-soft); }

/*--------------------------------------------------------------
 * Password + show/hide toggle
 *------------------------------------------------------------*/
.vcl-password-row {
    position: relative;
    display: flex;
    align-items: center;
}
.vcl-password-row input {
    padding-right: 44px;
}

/* Suppress the browser-native "reveal password" icon so it doesn't
 * duplicate our own eye toggle. Edge/WebView2 injects ::-ms-reveal,
 * Chrome's password autofill occasionally injects a key icon — both
 * eat horizontal space next to our toggle and confuse operators. */
.vcl-password-row input::-ms-reveal,
.vcl-password-row input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}
.vcl-password-row input::-webkit-credentials-auto-fill-button,
.vcl-password-row input::-webkit-contacts-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}
.vcl-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--vcl-muted);
    cursor: pointer;
}
.vcl-toggle:hover { background: rgba(0,0,0,0.04); color: var(--vcl-text); }
.vcl-toggle:focus-visible { outline: 2px solid var(--vcl-brand); outline-offset: 1px; }

.vcl-eye-closed { display: none; }
.vcl-toggle[aria-pressed="true"] .vcl-eye-open { display: none; }
.vcl-toggle[aria-pressed="true"] .vcl-eye-closed { display: inline; }

/* Caps Lock hint — subtle, only appears when JS toggles the class. */
.vcl-caps-hint {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--vcl-warn);
}
.vcl-field-password.is-caps-on .vcl-caps-hint { display: inline-flex; }
.vcl-caps-hint svg { flex: 0 0 auto; }

/*--------------------------------------------------------------
 * Row: remember + forgot
 *------------------------------------------------------------*/
.vcl-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    gap: 8px;
}
.vcl-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--vcl-muted);
    user-select: none;
    cursor: pointer;
}
.vcl-remember input {
    accent-color: var(--vcl-brand);
    width: 16px;
    height: 16px;
    margin: 0;
}
.vcl-forgot {
    font-size: 12px;
    color: var(--vcl-muted);
    text-decoration: none;
    transition: color 120ms ease;
}
.vcl-forgot:hover { color: var(--vcl-brand); text-decoration: underline; }

/*--------------------------------------------------------------
 * Submit — navy primary with premium depth
 *------------------------------------------------------------*/
.vcl-submit {
    position: relative;
    margin-top: 4px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #fff;
    background: var(--vcl-brand);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.06));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 1px 2px rgba(20, 27, 92, 0.35),
        0 6px 14px rgba(20, 27, 92, 0.22);
    transition:
        background 140ms ease,
        transform 80ms ease,
        box-shadow 140ms ease;
}
.vcl-submit:hover:not(:disabled) {
    background: var(--vcl-brand-dark);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 2px 3px rgba(13, 18, 68, 0.4),
        0 10px 20px rgba(13, 18, 68, 0.26);
    transform: translateY(-1px);
}
.vcl-submit:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 1px 2px rgba(13, 18, 68, 0.35);
}
.vcl-submit:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px var(--vcl-accent-tint),
        0 6px 14px rgba(20, 27, 92, 0.22);
}
.vcl-submit:disabled { opacity: 0.75; cursor: default; }

.vcl-submit-spinner {
    display: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vcl-spin 0.7s linear infinite;
}
.vcl-submit.is-loading .vcl-submit-spinner { display: block; }
.vcl-submit.is-loading .vcl-submit-label { opacity: 0.75; }

@keyframes vcl-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/*--------------------------------------------------------------
 * Footer + legal + version stamp
 *------------------------------------------------------------*/
.vcl-legal {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--vcl-muted);
    text-align: center;
    line-height: 1.5;
}
.vcl-legal a { color: var(--vcl-brand); text-decoration: none; }
.vcl-legal a:hover { text-decoration: underline; }

.vcl-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--vcl-muted);
    text-align: center;
}

/* Small hint line under a field ("Use at least 8 characters"). */
.vcl-hint {
    font-size: 12px;
    color: var(--vcl-muted);
    margin-top: 4px;
    display: block;
}

/* "← Back to sign in" secondary link at the bottom of the form. */
.vcl-back-link {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
}
.vcl-back-link a {
    color: var(--vcl-muted);
    text-decoration: none;
    transition: color 120ms ease;
}
.vcl-back-link a:hover { color: var(--vcl-brand); text-decoration: underline; }

/* When the button element is actually an <a> (used on the
 * expired-link screen for "Request a new link"), strip the anchor's
 * default text-decoration + centering so it reads as a button. */
.vcl-submit-link {
    display: block;
    text-align: center;
    text-decoration: none;
    margin-top: 4px;
}
.vcl-submit-link:hover { color: #fff; text-decoration: none; }

/* Small unobtrusive version stamp — useful when a shop owner phones
 * support and needs to say which build they're on. */
.vcl-version {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 10px;
    color: var(--vcl-muted-soft);
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}

/*--------------------------------------------------------------
 * Small screens
 *------------------------------------------------------------*/
@media (max-width: 480px) {
    .vcl-card {
        padding: 20px 18px 18px;
        border-radius: 12px;
    }
    .vcl-title { font-size: 20px; }
    .vcl-row-between { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Respect users who don't want fancy motion. */
@media (prefers-reduced-motion: reduce) {
    .vcl-submit,
    .vcl-submit-spinner {
        animation: none !important;
        transition: none !important;
    }
    .vcl-submit:hover:not(:disabled) { transform: none; }
}
