/* VTMS login and error pages (Tabler). */

/* Error pages (Shared/Error, ReportError): a card on the navy background. */
.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, .35), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(14, 165, 233, .25), transparent 45%),
        linear-gradient(135deg, #0b1f47 0%, #0f2a5f 55%, #1e3a8a 100%);
}

.error-card { max-width: 32rem; width: 100%; }

/* Display size, shared with the app (see site.css). */
html[data-ui-scale="75"] { font-size: 85.7143%; }
html[data-ui-scale="85"] { font-size: 97.1429%; }
html[data-ui-scale="100"] { font-size: 114.2857%; }

/* ---------- Sign-in page ----------
   Maritime split layout: a deep-navy harbour panel (chart contours and a compass rose) beside a clean sign-in form.
   The harbour panel shows from 992px up; below it, the PPA logos sit above the form. Colours come from Tabler, so the
   form panel follows the app's light and dark modes; the harbour panel is dark in both. */
.vtms-auth {
    --auth-navy-900: #071a33;
    --auth-navy-800: #0b2a52;
    --auth-navy-700: #123a6e;
    --auth-ink-soft: #b9c9de;
    --auth-ease: cubic-bezier(.16, 1, .3, 1);

    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    background-color: var(--tblr-bg-surface);
}

/* ----- Harbour panel ----- */
.vtms-auth-hero {
    display: none;
    position: relative;
    isolation: isolate;
    flex: 1 1 52%;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 90% at 85% 0%, var(--auth-navy-700) 0%, transparent 60%),
        linear-gradient(165deg, var(--auth-navy-800) 0%, var(--auth-navy-900) 100%);
}

.vtms-auth-chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    color: #7eb0e8;
    pointer-events: none;
}

.vtms-auth-contours { opacity: .16; }
.vtms-auth-compass { opacity: .2; transform-origin: 78% 82%; }

@keyframes vtms-auth-drift { to { transform: translate3d(-18px, 10px, 0); } }
@keyframes vtms-auth-spin { to { transform: rotate(360deg); } }
@keyframes vtms-auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.vtms-auth-brand { display: flex; align-items: center; gap: .9rem; }
.vtms-auth-brand-wordmark { height: 52px; width: auto; object-fit: contain; display: block; }
.vtms-auth-brand-mark { height: 92px; width: auto; object-fit: contain; display: block; }
.vtms-auth-brand-batangas { height: 76px; width: auto; object-fit: contain; display: block; }

.vtms-auth-pitch { max-width: 30rem; }
.vtms-auth-pitch h2 {
    color: #fff;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.025em;
    text-wrap: balance;
    margin: 0 0 1rem;
}

.vtms-auth-legal { margin: 0; font-size: .8rem; color: var(--auth-ink-soft); }

/* ----- Form panel ----- */
.vtms-auth-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: 1 1 48%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background-color: var(--tblr-bg-surface);
    background-image: radial-gradient(60% 55% at 100% 0%, rgba(var(--tblr-primary-rgb), .07) 0%, transparent 100%);
}

.vtms-auth-card { width: 100%; max-width: 400px; }

.vtms-auth-compact { display: flex; align-items: center; gap: .75rem; margin-bottom: 2rem; }
.vtms-auth-compact img { height: 42px; width: auto; object-fit: contain; }

.vtms-auth-card h1 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 .4rem;
}

.vtms-auth-sub { color: var(--tblr-secondary); font-size: .95rem; margin: 0 0 1.75rem; }
.vtms-auth-stay { color: var(--tblr-secondary); }

.vtms-auth-card .form-label { font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }

.vtms-auth-card .input-group {
    border-radius: .65rem;
    transition: box-shadow .18s var(--auth-ease);
}
.vtms-auth-card .input-group:focus-within { box-shadow: 0 0 0 4px rgba(var(--tblr-primary-rgb), .18); }

.vtms-auth-card .input-group > .form-control,
.vtms-auth-card .input-group > .input-group-text,
.vtms-auth-card .input-group > .btn {
    min-height: 46px;
    border-color: var(--tblr-border-color);
    background-color: var(--tblr-bg-surface);
}
.vtms-auth-card .input-group > :first-child { border-top-left-radius: .65rem; border-bottom-left-radius: .65rem; }
.vtms-auth-card .input-group > :last-child { border-top-right-radius: .65rem; border-bottom-right-radius: .65rem; }

.vtms-auth-card .input-group > .input-group-text { color: var(--tblr-secondary); border-right: 0; }
.vtms-auth-card .input-group > .form-control { font-size: 1rem; border-left: 0; box-shadow: none; }
.vtms-auth-card .input-group > .btn { color: var(--tblr-secondary); border-left: 0; box-shadow: none; }
.vtms-auth-card .input-group > .btn:hover { color: var(--tblr-primary); }

.vtms-auth-card .input-group:focus-within > .form-control,
.vtms-auth-card .input-group:focus-within > .input-group-text,
.vtms-auth-card .input-group:focus-within > .btn { border-color: var(--tblr-primary); }

.vtms-auth-card .input-group > .form-control.is-invalid,
.vtms-auth-card .input-group:has(.is-invalid) > .input-group-text,
.vtms-auth-card .input-group:has(.is-invalid) > .btn { border-color: var(--tblr-danger); }

/* Hide the empty message placeholders until a message is shown (login.js). */
.vtms-auth-card .field-validation-valid { display: none !important; }
.vtms-auth-card .field-validation-error { display: block; margin-top: .35rem; font-size: .8rem; }

.vtms-auth-submit {
    min-height: 48px;
    font-weight: 700;
    border-radius: .65rem;
    background-color: var(--auth-navy-800);
    border-color: var(--auth-navy-800);
    box-shadow: 0 4px 12px rgba(11, 42, 82, .28);
    transition: transform .18s var(--auth-ease), box-shadow .18s var(--auth-ease), background-color .18s;
}
.vtms-auth-submit:hover:not(:disabled) {
    background-color: var(--auth-navy-700) !important;
    border-color: var(--auth-navy-700) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(11, 42, 82, .32);
}
.vtms-auth-submit:active:not(:disabled) { transform: translateY(0); }
.vtms-auth-submit:disabled { opacity: .75; }

.vtms-auth-card ::selection,
.vtms-auth-hero ::selection { background-color: rgba(var(--tblr-primary-rgb), .3); }

/* Slow drift and turn, and one entrance for the card; still for users who ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
    .vtms-auth-contours { animation: vtms-auth-drift 60s ease-in-out infinite alternate; }
    .vtms-auth-compass { animation: vtms-auth-spin 240s linear infinite; }
    .vtms-auth-card { animation: vtms-auth-rise .7s var(--auth-ease) both; }
}

@media (min-width: 992px) {
    .vtms-auth-hero { display: flex; }
}

/* ----- Dark mode: the form panel follows the app's surface; the harbour panel is already dark ----- */
[data-bs-theme="dark"] .vtms-auth-submit {
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
[data-bs-theme="dark"] .vtms-auth-submit:hover:not(:disabled) {
    background-color: color-mix(in oklab, var(--tblr-primary) 85%, #000) !important;
    border-color: color-mix(in oklab, var(--tblr-primary) 85%, #000) !important;
}
[data-bs-theme="dark"] .vtms-auth-hero { border-right: 1px solid var(--tblr-border-color); }
[data-bs-theme="dark"] .vtms-auth-panel {
    background-image: radial-gradient(60% 55% at 100% 0%, rgba(var(--tblr-primary-rgb), .1) 0%, transparent 100%);
}

/* ----- CAPTCHA (drawn by the server; the picture keeps its own light background in dark mode too) ----- */
.vtms-captcha {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.vtms-captcha img {
    display: block;
    width: 200px;
    max-width: calc(100% - 3rem);
    height: auto;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    user-select: none;
}

#Captcha::placeholder { text-transform: none; }
