/**
 * Register Page Styles
 * Page-specific styles for the customer registration page.
 */

/* container-xxs caps the content box at 510px; the design calls for 560px inside the same gutters */
.register-page.container-xxs {
    max-width: 590px;
}

.register-page {
    /* Palette tokens mirror the site palette in resources/sass/_variables.scss */
    --reg-navy: #0E143E; /* $active */
    --reg-navy-hover: #1b2559;
    --reg-border: #d8d8d8; /* $gborder */
    --reg-text: #1b1c23; /* $text */
    --reg-tint: #f5f7fb;
    --reg-tint-border: #c8d3e8;
    --reg-label: #555555;
    --reg-muted: #888888;
    --reg-placeholder: #bbbbbb;
    --reg-rule: #e5e5e5;
    --reg-disabled: #dddddd;
    --reg-gap: 20px;
}

/* Intro */
.register-page .register-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--reg-text);
    margin-bottom: 10px;
}

.register-page .register-lead {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--reg-label);
    margin-bottom: 0;
}

.register-page .register-signin {
    margin: 16px 0 0;
    text-align: right;
}

/* The underline comes from the .text-underline utility; app.scss kills it on bare `a` */
.register-page .register-signin a {
    font-size: 13px;
    color: var(--reg-navy);
    text-underline-offset: 4px;
}

.register-page .register-signin a:hover {
    opacity: 0.7;
}

/* Section eyebrow */
.register-page .register-eyebrow {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--reg-label);
    margin-bottom: 12px;
}

/* Account type cards */
.register-page .account-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.register-page .account-type-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.register-page .account-type-card__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.register-page .account-type-card__body {
    position: relative;
    display: block;
    height: 100%;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--reg-border);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.register-page .account-type-card:hover .account-type-card__body {
    border-color: var(--reg-muted);
}

.register-page .account-type-card__input:checked + .account-type-card__body {
    border-color: var(--reg-navy);
    background: var(--reg-tint);
}

.register-page .account-type-card__input:focus-visible + .account-type-card__body {
    outline: 2px solid var(--reg-navy);
    outline-offset: 2px;
}

.register-page .account-type-card__check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: none;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: var(--reg-navy);
    color: #fff;
    font-size: 8px;
}

.register-page .account-type-card__input:checked + .account-type-card__body .account-type-card__check {
    display: block;
}

.register-page .account-type-card__icon {
    display: block;
    margin-bottom: 12px;
    color: var(--reg-muted);
}

.register-page .account-type-card__input:checked + .account-type-card__body .account-type-card__icon {
    color: var(--reg-navy);
}

.register-page .account-type-card__name {
    display: block;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--reg-text);
    margin-bottom: 4px;
}

.register-page .account-type-card__input:checked + .account-type-card__body .account-type-card__name {
    color: var(--reg-navy);
}

.register-page .account-type-card__desc {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    color: var(--reg-muted);
}

/* Fields */
.register-page .register-fields > * + * {
    margin-top: var(--reg-gap);
}

.register-page .register-field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.register-page .register-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--reg-label);
    margin-bottom: 8px;
}

/*
 * font-size and border-radius are !important app-wide on .form-control
 * (custom/css/main.css and resources/sass/app.scss), so the design's square
 * 14px field can only be restored by matching that weight here.
 */
.register-page .form-control {
    height: auto;
    padding: 12px;
    font-size: 14px !important;
    color: var(--reg-text);
    background: #fff;
    border: 1px solid var(--reg-border);
    border-radius: 0 !important;
}

/* app.scss sizes and colours the placeholder with !important too */
.register-page .form-control::placeholder {
    font-size: 14px !important;
    color: var(--reg-placeholder) !important;
}

.register-page .form-control:focus {
    border-color: var(--reg-navy);
    box-shadow: none;
}

.register-page .form-control.is-invalid {
    border-color: #E70C3B; /* $red */
}

/* app.scss indents this by 0.8rem to clear the padded labels of the old form layout */
.register-page .invalid-feedback {
    padding: 0;
    margin-top: 6px;
    font-size: 12px;
}

/* The phone field is a number input; its spinners would break the field's outline */
.register-page input[type="number"].form-control {
    appearance: textfield;
    -moz-appearance: textfield;
}

.register-page input[type="number"].form-control::-webkit-outer-spin-button,
.register-page input[type="number"].form-control::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

/* Native selects drop their own caret in favour of the one drawn on .register-select */
.register-page select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    cursor: pointer;
}

.register-page .register-select {
    position: relative;
}

/* Same fontello chevron the selectpicker toggles use (app.scss .dropdown-toggle::after) */
.register-page .register-select::after {
    content: "\f107";
    font-family: "fontello";
    position: absolute;
    top: 50%;
    right: 12px;
    font-size: 14px;
    line-height: 1;
    color: var(--reg-navy);
    transform: translateY(-50%);
    pointer-events: none;
}

/* Phone number: dialling code sits flush against the number field */
.register-page .register-phone {
    display: flex;
}

/* Wide enough for the longest dialling code (+998) plus the chevron */
.register-page .register-phone__code {
    flex: 0 0 92px;
}

.register-page .register-phone__code select.form-control {
    border-right: 0;
}

.register-page .register-phone input.form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* Password visibility toggle */
.register-page .register-password {
    position: relative;
}

.register-page .register-password .form-control {
    padding-right: 40px;
}

.register-page .register-password__toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    padding: 0;
    line-height: 1;
    color: #aaaaaa;
    background: none;
    border: 0;
    transform: translateY(-50%);
}

.register-page .register-password__toggle:hover {
    color: var(--reg-label);
}

.register-page .register-password__toggle:focus:not(:focus-visible) {
    outline: none;
}

.register-page .register-password__toggle .password-eye--visible,
.register-page .register-password__toggle.is-visible .password-eye--hidden {
    display: none;
}

.register-page .register-password__toggle.is-visible .password-eye--visible {
    display: block;
}

/* Organisation-only fields */
.register-page .companyblog > * + * {
    margin-top: var(--reg-gap);
}

.register-page .register-radios {
    display: flex;
    gap: 24px;
    margin-top: 4px;
}

.register-page .register-radios .form-check-input {
    accent-color: var(--reg-navy);
}

.register-page .register-radios .form-check-label {
    font-size: 14px;
    color: var(--reg-text);
}

/* Identity verification notice */
.register-page .register-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--reg-tint);
    border: 1px solid var(--reg-tint-border);
}

.register-page .register-notice__icon {
    flex: 0 0 auto;
    display: block;
    margin-top: 1px;
    color: var(--reg-navy);
}

.register-page .register-notice__title {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--reg-navy);
    margin-bottom: 4px;
}

.register-page .register-notice__body {
    font-size: 12px;
    line-height: 1.5;
    color: #2a3d6b;
    margin-bottom: 0;
}

/* Consents */
.register-page .register-consents {
    padding-top: var(--reg-gap);
    border-top: 1px solid var(--reg-rule);
}

.register-page .register-consent {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.register-page .register-consent + .register-consent {
    margin-top: 16px;
}

.register-page .register-consent p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--reg-text);
    margin-bottom: 0;
}

.register-page .register-consent a {
    color: var(--reg-navy);
    text-underline-offset: 2px;
}

/* Marketing switch */
.register-page .register-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.register-page .register-switch {
    flex: 0 0 auto;
    display: block;
    width: 36px;
    height: 20px;
    margin: 2px 0 0;
    background: #cccccc;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.register-page .register-switch::after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    margin: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.register-page .register-switch__input:checked + .register-switch {
    background: var(--reg-navy);
}

.register-page .register-switch__input:checked + .register-switch::after {
    transform: translateX(16px);
}

/* Terms checkbox */
.register-page .register-check__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.register-page .register-check {
    flex: 0 0 auto;
    display: block;
    width: 16px;
    height: 16px;
    margin: 4px 0 0;
    line-height: 16px;
    text-align: center;
    font-size: 8px;
    color: transparent;
    background: #fff;
    border: 1px solid #aaaaaa;
    cursor: pointer;
}

.register-page .register-check:hover {
    border-color: var(--reg-label);
}

.register-page .register-check__input:checked + .register-check {
    color: #fff;
    background: var(--reg-navy);
    border-color: var(--reg-navy);
}

/* Submit */
.register-page .register-submit {
    width: 100%;
    padding: 16px;
    font-size: 12px;
    letter-spacing: 0.2em;
}

.register-page .register-submit:disabled {
    color: #aaaaaa;
    background: var(--reg-disabled);
    border-color: var(--reg-disabled);
    opacity: 1;
    cursor: not-allowed;
}

.register-page .register-submit-hint {
    font-size: 12px;
    color: #999999;
    text-align: center;
    margin-bottom: 0;
}

/* Verify identity page */
.register-page .verify-created {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--reg-rule);
}

.register-page .verify-created .register-eyebrow {
    color: var(--reg-navy);
}

.register-page .verify-created__tick {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    line-height: 32px;
    text-align: center;
    font-size: 13px;
    color: #fff;
    background: var(--reg-navy);
}

.register-page .verify-created__text {
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--reg-label);
}

.register-page .verify-steps__heading {
    margin-top: 32px;
}

.register-page .verify-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--reg-rule);
}

.register-page .verify-step {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--reg-rule);
}

.register-page .verify-step:last-child {
    border-bottom: 0;
}

.register-page .verify-step__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--reg-navy);
    background: var(--reg-tint);
    border: 1px solid var(--reg-tint-border);
}

.register-page .verify-step__body {
    flex: 1 1 auto;
    min-width: 0;
}

.register-page .verify-step__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.register-page .verify-step__title {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--reg-text);
}

.register-page .verify-step__number {
    flex: 0 0 auto;
    padding-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: #cccccc;
}

.register-page .verify-step__description {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #666666;
}

.register-page .verify-later {
    margin: 10px 0 0;
    text-align: center;
}

.register-page .verify-later a {
    font-size: 12px;
    color: var(--reg-muted);
}

.register-page .verify-later a:hover {
    color: #333333;
}

@media (max-width: 575.98px) {
    .register-page .register-field-pair {
        grid-template-columns: 1fr;
    }

    .register-page .account-type-card__body {
        padding: 16px;
    }

    .register-page .verify-step {
        gap: 12px;
        padding: 16px;
    }
}
