/* =========================================================
   Grand Password Manager - sign-in pages
   Same style as Grand Picker (Content/picker.css)
   Brand: Grand red #D6121B, sun yellow #FDB913
   ========================================================= */
:root {
    --gp-red: #D6121B;
    --gp-red-dark: #B30F17;
    --gp-red-deep: #9E0D14;
    --gp-sun: #FDB913;
    --gp-ink: #241614;
    --gp-muted: #6B5A55;
    --gp-faint: #8A7873;
    --gp-ground: #FFF8F0;
    --gp-field: #FFF4EA;
    --gp-white: #ffffff;
    --gp-green: #11663F;
    --gp-green-bg: #E3F6EA;
    --gp-error-bg: #FFE5E6;
    --gp-radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

.gp-body {
    background: var(--gp-ground);
    color: var(--gp-ink);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Phone-width column, centred on tablets / desktop */
.gp-app {
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--gp-ground);
    display: flex;
    flex-direction: column;
    position: relative;
}
@media (min-width: 520px) {
    .gp-body { background: #F1E6DC; }
    .gp-app { box-shadow: 0 0 40px rgba(60, 20, 10, .10); }
}

/* ---------------- Red hero with logo ---------------- */
.gp-login-hero {
    position: relative;
    overflow: hidden;
    background: var(--gp-red);
    height: 300px;
    border-radius: 0 0 44px 44px;
    padding-top: calc(54px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gp-hero-deco { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .14; }
.gp-logo-card {
    position: relative;
    background: var(--gp-white);
    border-radius: 26px;
    padding: 14px 22px;
    box-shadow: 0 14px 30px rgba(80, 0, 4, .28);
}
.gp-logo-card img { display: block; width: 150px; height: auto; }
.gp-hero-caption {
    position: relative;
    margin-top: 22px;
    color: var(--gp-white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
}

/* ---------------- Card ---------------- */
.gp-login-card {
    position: relative;
    margin: -40px 20px 0;
    background: var(--gp-white);
    border-radius: 28px;
    padding: 26px 22px 22px;
    box-shadow: 0 10px 34px rgba(60, 20, 10, .12);
    display: flex;
    flex-direction: column;
}
.gp-login-card h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.gp-sub { margin: 4px 0 18px; font-size: 14px; color: var(--gp-muted); line-height: 1.45; }

.gp-label {
    display: block;
    margin: 4px 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gp-muted);
    letter-spacing: .4px;
}
.gp-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 6px 0 14px;
    margin-bottom: 14px;
    background: var(--gp-field);
    border-radius: 16px;
    border: 2px solid transparent;
    transition: border-color .15s;
}
.gp-field:focus-within { border-color: var(--gp-sun); }
.gp-field > svg {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: var(--gp-red); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.gp-field input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--gp-ink);
}
.gp-field input::placeholder { color: #A8968F; font-weight: 500; }
.gp-eye {
    width: 44px; height: 44px; flex: none;
    border: 0; background: transparent; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.gp-eye svg {
    width: 20px; height: 20px;
    fill: none; stroke: var(--gp-muted); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.gp-eye.on svg { stroke: var(--gp-red); }
.gp-caps { display: none; margin: -8px 0 12px 4px; font-size: 12px; font-weight: 700; color: #7A4B00; }
.gp-caps.show { display: block; }
.gp-hint { margin: -8px 0 14px 4px; font-size: 12px; color: var(--gp-muted); }

.gp-row-between { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 16px; gap: 10px; flex-wrap: wrap; }
.gp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gp-muted); font-weight: 500; }
.gp-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--gp-red); }
.gp-check label { cursor: pointer; }
.gp-link {
    color: var(--gp-red-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 0;
    background: none; border: 0; cursor: pointer; font-family: inherit;
}
.gp-link:hover { color: var(--gp-red-deep); text-decoration: underline; }

/* ---------------- Buttons ---------------- */
.gp-btn {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: var(--gp-radius);
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: transform .08s, opacity .15s;
}
.gp-btn:active { transform: scale(.98); }
.gp-btn.is-busy { opacity: .75; pointer-events: none; }
.gp-btn-primary { background: var(--gp-red); color: var(--gp-white); box-shadow: 0 10px 22px rgba(214, 18, 27, .32); }
.gp-btn-primary:hover { background: var(--gp-red-dark); }
a.gp-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------------- Alerts ---------------- */
.gp-alert { border-radius: 14px; padding: 11px 14px; margin-bottom: 14px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.gp-alert:empty { display: none; }
.gp-alert-error { background: var(--gp-error-bg); color: var(--gp-red-deep); }
.gp-alert-success { background: var(--gp-green-bg); color: var(--gp-green); }
.gp-alert-info { background: #FFF1D6; color: #7A4B00; }
.gp-help { display: none; }
.gp-help.show { display: block; }

/* ---------------- Footer ---------------- */
.gp-footer {
    margin-top: auto;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 12px;
    color: var(--gp-faint);
}

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gp-sun); outline-offset: 2px; }
.gp-field input:focus-visible { outline: none; }

@media (max-width: 380px), (max-height: 700px) {
    .gp-login-hero { height: 250px; padding-top: calc(40px + env(safe-area-inset-top, 0px)); border-radius: 0 0 36px 36px; }
    .gp-logo-card img { width: 128px; }
    .gp-hero-caption { margin-top: 16px; }
    .gp-login-card { margin: -36px 14px 0; padding: 22px 18px 18px; }
    .gp-btn { height: 50px; font-size: 15px; border-radius: 15px; }
}
