:root {
    --hb-primary: #00472e;
    --hb-border: #000000;
    --hb-neutral: #404147;
    --background: #ffffff;
    --surface-variant: #F2F9F8;
    --hb-border-strong: #000000;
    --hb-text: #2a2a2a;
    --hb-muted: #6a6a73;
    --hb-focus: #000000;
    --link: #0e8f6e;
    --error: #c62828;
    --field-radius: 4px;
    --container-w: 420px;
    --mdc-checkbox-checked-color: #00472e;
}

.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3); /* light background ring */
    border-top: 2px solid white; /* spinning part */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ensure button is positioned relative so spinner can center */
#submitBtn {
    position: relative;
}

/* center spinner */
#submitBtn .spinner {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.qr-image {
    width: 225px;
    height: 225px;
}

.qr-image img {
    width: 100%;
    height: 100%;
    margin: auto;
    align-self: center
}

.qr-card {
    margin: 0;
    padding-top: 32px;
    padding-bottom: 32px;
    background-color: var(--background);
    border-radius: 16px;
    box-shadow: 0 4px 16px 0 rgba(16, 18, 25, 0.08);
    width: 325px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.apps-card {
    margin: 0;
    margin-top: 16px;
    padding: 8px 16px 8px 16px;;
    background: linear-gradient(251.92deg, var(--hb-primary) 0%, #0E8156 100%);
    max-width: 325px;
    border-radius: 16px;
    display: flex;
    align-items: center;
}

#promotion-text{
    text-align: center;
    margin-right: 8px;
}
#account-created-text{
    font-family: "Figtree-Bold", ui-sans-serif;
    font-weight: 400;
    line-height: 140%;
    color: var(--hb-neutral);
    font-size: 22px;
    max-width: 280px;
    align-self: center;
    text-align: center;
}

#tick_img {
    margin-left: 8px;
    vertical-align: middle;
    margin-bottom: 4px;
    width: 20px;
    height: 20px;
}
#promotion-title{
    font-family: "Figtree-Bold", ui-sans-serif;
    font-weight: 600;
    line-height: 140%;
    color: white;
    font-size: 18px;
    max-width: 280px;
}
#badges{
    align-content: center;
    text-align: end;

}

.qr-wrap {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.tinted {
    background-color: var(--surface-variant);
}


/* Red label when invalid */
.mdc-text-field--invalid .mdc-floating-label {
    color: #C62828;
    font-weight: 700; /* heavier, matches the mock’s emphasis */
}

.mdc-text-field {
    margin-top: 12px; /* space under the field */
}

.mdc-text-field-helper-line {
    margin: 0 2px 0 0;
}


/* Red box for the checkbox when invalid */
#terms[aria-invalid="true"] + .mdc-checkbox__background {
    border-color: #C62828;
    border-width: 2px;
}
.mdc-checkbox__background {
    background-color: var(--hb-primary);
    border-color: var(--hb-primary);
}

/* Terms helper under the box */
.help[data-for="terms"] {
    margin: 6px 0 0 40px; /* align under the label (tweak as needed) */
    color: #C62828;
    font-size: 0.95rem;
}

/* Trailing icon in a red circle when invalid */
.mdc-text-field-icon {
    opacity: 0;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    color: var(--error);
    align-self: center;
    border: 2px solid transparent;
    font-size: 20px; /* material symbol size */
}

.mdc-text-field-icon-show {
    opacity: 1;
}

.fullwidth {
    width: 100%;
}

/* Align checkbox with long fineprint text */
.mdc-form-field.withlabel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mdc-form-field.onlybox {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
}

@font-face {
    font-family: 'Figtree';
    src: url('font/hb_figtree-regular.otf') format('opentype'),
    url('font/hb_figtree-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* prevents invisible text while loading */
}

@font-face {
    font-family: 'Figtree-Bold';
    src: url('font/hb_figtree-semibold.otf') format('opentype'),
    url('font/hb_figtree-semibold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap; /* prevents invisible text while loading */
}

@font-face {
    font-family: 'Figtree-Light';
    src: url('font/hb_figtree-regular.otf') format('opentype'),
    url('font/hb_figtree-regular.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap; /* prevents invisible text while loading */
}

* {
    box-sizing: border-box
}


/* Full-width, rounded, raised button */
.cta.mdc-button {
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
    text-transform: none;
    /* center content */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1px;
    /* kill stray borders */
    border: none;
}

.cta.mdc-button.mdc-button--raised {
    background-color: var(--hb-primary);
    border-radius: 4px;
    color: #fff;
    /* subtle lift */
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12),
    0 6px 12px rgba(0, 0, 0, 0.18);
}

/* Text styling */
.cta .mdc-button__label {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 2px;
    font-family: "Figtree-Bold", ui-sans-serif; /* tight */
}

/* Hover/active states */
.cta.mdc-button:hover {
    background-color: var(--hb-primary);
}

.cta.mdc-button:active {
    background-color: var(--hb-primary);
}

/* Stronger white ripple on dark bg */
.cta.mdc-button .mdc-button__ripple::before,
.cta.mdc-button .mdc-button__ripple::after {
    background-color: rgba(255, 255, 255, 0.30);
}

/* Accessible focus ring on dark bg */
.cta.mdc-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Figtree', ui-sans-serif;
    color: var(--hb-text);
    background: #fff;
}

/* prevent iOS zoom on focus */
input, select, textarea {
    font-size: 16px;
}

#scan-title{
    font-size: 20px;
    font-family: "Figtree", ui-sans-serif;
    font-weight: 600;
    line-height: 140%;
    color: var(--hb-neutral);
    align-self: center;
    margin-bottom: 32px;
    margin-top: 0;
}
/* ===== Layout ===== */
.wrap {
    display: grid;
    place-items: start center;
    padding: 24px 16px 32px;
}

.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
}

.logo {
    width: 240px;
    margin: auto;
    display: block;
    position: relative;
    margin-bottom: 12px
}

h1 {
    font-weight: 500;
    font-size: 24px;
    line-height: 1.25;
    text-align: center;
    margin: 8px 0 28px;
}

form {
    width: 100%
}

/* ===== Floating label (Material-like) ===== */
.form-field {
    margin-bottom: 1px
}

.field-wrap {
    position: relative
}

.field-wrap input {
    width: 100%;
    border: 1px solid var(--hb-border);
    border-radius: var(--field-radius);
    outline: none;
    padding: 22px 46px 12px 16px; /* top space for floating label */
    font-size: 16px;
    line-height: 1.4;
    background: #fff;
    transition: border .15s ease, box-shadow .15s ease;
}

input[data-autocompleted] {
    background-color: transparent !important;
}

input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 0s 0s, color 0s 0s;
    transition-delay: calc(infinity * 1s);
}

.field-wrap input:focus {
    border-color: var(--hb-border);
    border-width: 2px;
    background-color: white;
    /*box-shadow:0 0 0 4px color-mix(in srgb, var(--hb-focus) 20%, transparent);*/
}

.field-wrap label {
    position: absolute;
    left: 16px;
    top: 22px;
    color: #6a6a73;
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
    transform-origin: left top;
    transition: all .12s ease;
    background: transparent;
    padding: 0 4px;
}

/* Floating condition: focused OR not placeholder-shown (has value) */
.field-wrap input:focus + label,
.field-wrap input:not(:placeholder-shown) + label {
    top: -5px;
    left: 12px;
    font-size: 12px;
    background: #fff;
}

/* error state */
.form-field-error {
    border-color: var(--error);
    color: var(--error);
    font-size: 12px;
    margin: 0;
    padding: 0;
}

/* helper text */
.help {
    margin: 6px 0 0 0;
    font-size: 14px;
    color: var(--error);
    min-height: 18px
}

/* ===== Helper block (marketing) ===== */
.helper-block {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0 2px;
    color: var(--hb-muted);
    font-size: 14px
}

.fineprint {
    font-weight: 200;
    font-size: 12px;
    color: var(--hb-neutral);
}

.fineprint .link {
    color: var(--link);
    text-decoration: none
}

.fineprint .link:hover {
    text-decoration: underline
}

.divider {
    height: 1px;
    background: #efeff2;
    margin: 18px 0 10px
}

.spacer {
    margin: 16px
}

/* ===== Checkbox styles ===== */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0
}

.checkbox input {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #9a9aa3;
    border-radius: 6px;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: border .15s ease, background .15s ease
}

.checkbox input:checked {
    background: var(--hb-primary);
    border-color: var(--hb-primary)
}

.checkbox input:checked::after {
    content: "";
    display: block;
    width: 10px;
    height: 6px;
    border: 2px solid #fff;
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg);
    margin-top: -2px
}

.checkbox label {
    font-weight: 500;
    color: #333;
    margin: 0;
    cursor: pointer
}

/* checkbox error */
.checkbox.withlabel.error input {
    border-color: var(--error)
}

.help[data-for="terms"] {
    margin-left: 34px
}

/* T&C link styling (as requested) */
.checkbox.withlabel a.tandc-link {
    color: var(--hb-primary);
    text-decoration: underline;
    font-weight: 600;
}

/* ===== Button ===== */
.cta {
    display: block;
    width: 100%;
    background: var(--hb-primary);
    color: #fff;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    padding: 16px 20px;
    cursor: pointer;
    transition: opacity .2s ease, transform .02s ease, background .2s ease;
    margin-top: 16px;
}

.cta:active {
    transform: translateY(1px)
}

/* ===== Responsiveness ===== */
@media (max-width: 768px) {
    :root {
        --container-w: 600px;
    }

    .wrap {
        padding: 40px 14px 24px
    }

    h1 {
        font-size: 26px;
        margin-bottom: 24px
    }

    .field-wrap input {
        padding: 20px 44px 12px 14px
    }

    .field-wrap label {
        left: 14px
    }
}

@media (max-width: 480px) {
    :root {
        --container-w: 100%;
    }

    .wrap {
        padding: 28px 12px 20px
    }

    .logo svg {
        height: 36px
    }

    h1 {
        font-size: 24px
    }

    .field-wrap input {
        padding: 18px 40px 12px 12px;
        font-size: 16px
    }

    .field-wrap label {
        left: 12px
    }

    .checkbox label {
        font-size: 14px
    }

    .help {
        font-size: 13px
    }
}


.field-error{
    border-width: 4px;
    border-color: var(--error);
    color: var(--error);
}

.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading, .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing {
    border-color: var(--hb-focus);
}

.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading, .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch, .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing {
    border-color: var(--hb-focus);

}

.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
    color: var(--hb-focus);
}

.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label {
    font-family: 'Figtree-Light', ui-sans-serif;
    font-size: 16px;
    color: var(--hb-muted);
    font-weight: lighter;
}

.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input {
    font-family: 'Figtree', ui-sans-serif;
    color: var(--hb-muted);
    font-size: 12px;
}


#firstName{
    text-transform: capitalize;
}
#lastName{
    text-transform: capitalize;
}

@media (max-width: 360px) {
    .wrap {
        padding: 20px 10px 16px
    }

    .logo svg {
        height: 32px
    }

    h1 {
        font-size: 22px;
        margin-bottom: 18px
    }

    .field-wrap input {
        padding: 16px 36px 10px 12px
    }

    .field-wrap label {
        top: 14px
    }

}

@media (max-width: 330px) {
    .field-wrap input {
        padding: 14px 34px 10px 10px
    }

    .field-wrap label {
        left: 10px
    }
}

