/* Gift voucher balance page (/gift-voucher)
   Single-purpose page: one input, one answer. Layout is deliberately sparse so the balance is the only
   thing competing for attention. Mobile-first; the desktop rules only widen the container. */

.gv {
    --gv-brand: #1ea199;
    --gv-brand-dark: #187d75;
    --gv-brand-tint: #f4fbfa;
    --gv-ink: #263238;
    --gv-muted: #59666d;
    --gv-line: #e1e1e1;
    --gv-warn: #a8631a;
    --gv-warn-tint: #fdf6ec;
    --gv-error: #b3261e;
    --gv-error-tint: #fdf1f0;

    --gv-radius: 14px;
    --gv-gap: 24px;

    background: linear-gradient(180deg, var(--gv-brand-tint) 0%, #fff 460px);
    padding: 56px 20px 88px;
}

.gv__shell {
    max-width: 680px;
    margin: 0 auto;
}

/* ---------- Header ---------- */

.gv__header {
    text-align: center;
    margin-bottom: 40px;
}

.gv__title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--gv-ink);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gv__subtitle {
    font-family: 'Roboto Slab', serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--gv-muted);
    margin: 0 auto;
    max-width: 460px;
}

/* ---------- Card ---------- */

.gv__card {
    background: #fff;
    border: 1px solid var(--gv-line);
    border-radius: var(--gv-radius);
    box-shadow: 0 4px 24px rgba(38, 50, 56, 0.07);
    padding: 40px 32px;
}

/* ---------- Input ---------- */

.gv__label {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gv-ink);
    margin-bottom: 10px;
}

.gv__hint {
    font-family: 'Roboto Slab', serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gv-muted);
    margin-bottom: 18px;
}

/* Monospace + tracking so a 19-character code stays readable while being typed off a printed card.
   One real input (not four boxes) to keep paste, autofill and screen readers working.

   Selector deliberately carries the type + attribute: global.css has
   `input[type="text"] { height: 40px; width: 300px; background: #f2f2f2; }` at specificity (0,1,1), which
   outranks a bare class and was clipping the code, squashing the height and greying the background. */
input[type="text"].gv__input {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    color: var(--gv-ink);
    background: #fff;
    border: 2px solid var(--gv-line);
    border-radius: 10px;
    padding: 20px 16px;
    height: auto;
    min-height: 68px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gv__input::placeholder {
    color: #b6bfc4;
    font-weight: 400;
    letter-spacing: 2px;
}

.gv__input:focus {
    outline: none;
    border-color: var(--gv-brand);
    box-shadow: 0 0 0 4px rgba(30, 161, 153, 0.16);
}

input[type="text"].gv__input--error {
    border-color: var(--gv-error);
}

.gv__input--error:focus {
    box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.14);
}

/* ---------- Buttons ---------- */

.gv__button {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 20px 28px;
    min-height: 62px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: var(--gv-brand);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.gv__button:hover:not(:disabled) {
    background: var(--gv-brand-dark);
}

.gv__button:active:not(:disabled) {
    transform: translateY(1px);
}

.gv__button:focus-visible {
    outline: 3px solid var(--gv-brand-dark);
    outline-offset: 3px;
}

.gv__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gv__actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 32px;
}

.gv__cta {
    display: block;
    text-align: center;
    padding: 20px 28px;
    min-height: 62px;
    box-sizing: border-box;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 21px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gv__cta--primary {
    background: var(--gv-brand);
    color: #fff;
}

.gv__cta--primary:hover {
    background: var(--gv-brand-dark);
    color: #fff;
    text-decoration: none;
}

.gv__cta--secondary {
    background: #fff;
    color: var(--gv-brand-dark);
    border: 2px solid var(--gv-brand);
}

.gv__cta--secondary:hover {
    background: var(--gv-brand-tint);
    color: var(--gv-brand-dark);
    text-decoration: none;
}

/* ---------- Result ---------- */

.gv__result {
    margin-top: 36px;
    padding-top: 36px;
    border-top: 1px solid var(--gv-line);
}

/* The hero figure. Everything else on the page is sized relative to this being the answer. */
.gv__balance {
    text-align: center;
    padding: 32px 20px;
    background: var(--gv-brand-tint);
    border-radius: var(--gv-radius);
}

.gv__balance-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gv-brand-dark);
    margin-bottom: 6px;
}

.gv__balance-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 68px;
    line-height: 1;
    font-weight: 700;
    color: var(--gv-brand-dark);
    margin: 0;
}

/* ---------- Spent / original breakdown ---------- */

.gv__figures {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.gv__figure {
    flex: 1;
    text-align: center;
    padding: 20px 12px;
    border: 1px solid var(--gv-line);
    border-radius: 10px;
}

.gv__figure-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gv-muted);
    margin-bottom: 4px;
}

.gv__figure-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--gv-ink);
}

.gv__bar {
    margin-top: 24px;
    height: 12px;
    border-radius: 6px;
    background: var(--gv-line);
    overflow: hidden;
}

.gv__bar-fill {
    height: 100%;
    background: var(--gv-brand);
    border-radius: 6px;
}

.gv__bar-caption {
    font-family: 'Roboto Slab', serif;
    font-size: 13px;
    color: var(--gv-muted);
    text-align: center;
    margin-top: 10px;
}

/* ---------- Messages ---------- */

.gv__message {
    padding: 26px 24px;
    border-radius: var(--gv-radius);
    text-align: center;
}

.gv__message--neutral {
    background: #f7f8f8;
    border: 1px solid var(--gv-line);
}

.gv__message--warn {
    background: var(--gv-warn-tint);
    border: 1px solid #f0d9b8;
}

.gv__message--error {
    background: var(--gv-error-tint);
    border: 1px solid #f2cdca;
}

.gv__message-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gv-ink);
    margin: 0 0 10px;
}

.gv__message-body {
    font-family: 'Roboto Slab', serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--gv-muted);
    margin: 0;
}

.gv__message-body a {
    color: var(--gv-brand-dark);
    font-weight: 700;
}

/* Inline validation under the input. Hidden until JS or the server sets an error. */
.gv__error {
    display: none;
    font-family: 'Roboto Slab', serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gv-error);
    margin-top: 12px;
}

.gv__error--visible {
    display: block;
}

/* Shown when we silently fixed characters that cannot occur in a real code (O->0, I->1...). */
.gv__notice {
    display: none;
    font-family: 'Roboto Slab', serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--gv-muted);
    background: var(--gv-brand-tint);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
}

.gv__notice--visible {
    display: block;
}

/* ---------- History ---------- */

.gv__history {
    margin-top: 32px;
}

.gv__history-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gv-ink);
    margin: 0 0 14px;
}

.gv__history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--gv-line);
    border-radius: 10px;
    overflow: hidden;
}

.gv__history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    font-family: 'Roboto Slab', serif;
    font-size: 15px;
    color: var(--gv-ink);
}

.gv__history-item + .gv__history-item {
    border-top: 1px solid var(--gv-line);
}

.gv__history-amount {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.gv__history-empty {
    font-family: 'Roboto Slab', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gv-muted);
    background: #f7f8f8;
    border: 1px solid var(--gv-line);
    border-radius: 10px;
    padding: 18px 20px;
}

/* ---------- Reassurance / footer ---------- */

.gv__reassure {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gv__reassure-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Roboto Slab', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gv-muted);
}

.gv__reassure-icon {
    color: var(--gv-brand);
    font-size: 16px;
    line-height: 1.5;
    flex-shrink: 0;
}

.gv__footlinks {
    margin-top: 32px;
    text-align: center;
    font-family: 'Roboto Slab', serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--gv-muted);
}

.gv__footlinks a {
    color: var(--gv-brand-dark);
    font-weight: 700;
}

.gv__recaptcha {
    margin-top: 22px;
    display: flex;
    justify-content: center;
}

/* ---------- MyAccount: My Gift Vouchers ---------- */

.gv-account__summary {
    margin-bottom: 28px;
}

.gv-account__amount--inactive {
    color: var(--gv-muted);
}

.gv-account__note {
    font-family: 'Roboto Slab', serif;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gv-muted);
    margin-top: 16px;
}

.gv-account__note a {
    color: var(--gv-brand-dark);
    font-weight: 700;
}

/* The account page reuses .gv__* blocks outside the .gv wrapper, so it needs the variables in scope. */
.gv-account {
    --gv-brand: #1ea199;
    --gv-brand-dark: #187d75;
    --gv-brand-tint: #f4fbfa;
    --gv-ink: #263238;
    --gv-muted: #59666d;
    --gv-line: #e1e1e1;
    --gv-radius: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 575px) {
    .gv {
        padding: 32px 14px 64px;
    }

    .gv__card {
        padding: 28px 20px;
    }

    .gv__title {
        font-size: 34px;
    }

    /* Sized so all 19 characters still fit at a 320px viewport: Courier advance is 0.6em, so
       19 x (17 x 0.6 + 1) ~= 213px inside ~252px of available width. */
    input[type="text"].gv__input {
        font-size: 17px;
        letter-spacing: 1px;
        padding: 18px 8px;
        min-height: 60px;
    }

    .gv__balance-value {
        font-size: 54px;
    }

    /* Stack rather than squeeze two figures onto a narrow screen. */
    .gv__figures {
        flex-direction: column;
        gap: 12px;
    }

    .gv__figure {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 16px 18px;
    }

    .gv__figure-label,
    .gv__figure-value {
        margin: 0;
    }
}

@media (min-width: 576px) {
    .gv__actions {
        flex-direction: row;
    }

    .gv__cta {
        flex: 1;
    }
}
