/* Signup and login pages. Colors follow the Realnaps account-experience designs. */

:root {
    --auth-page: #0b1712;
    --auth-card: #10241b;
    --auth-field: #0b1712;
    --auth-field-border: #1f3c2d;
    --auth-text: #f3f6f2;
    --auth-muted: #a9b8ae;
    --auth-subtle: #7d9084;
    --auth-green: #08913a;
    --auth-green-hover: #0aa545;
    --auth-lime: #b9e660;
    --auth-pill: #173424;
    --auth-error-bg: rgba(255, 107, 94, 0.12);
    --auth-error-text: #ffb4ab;
    --auth-success-bg: rgba(185, 230, 96, 0.12);
    --auth-success-text: #d6f5a0;
    --auth-radius-card: 28px;
    --auth-radius-field: 12px;
}

* {
    box-sizing: border-box;
}

.auth-body {
    margin: 0;
    background: var(--auth-page);
    color: var(--auth-text);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Layout: image panel + form column */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-visual {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    background: linear-gradient(180deg, #006c04 0%, #043d1d 100%);
}

.auth-visual img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.auth-mobile-brand {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    padding: 44px 44px 36px;
    background: var(--auth-card);
    border-radius: var(--auth-radius-card);
}

/* Card header */

.auth-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-pill {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--auth-pill);
    color: var(--auth-lime);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-step {
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-logo {
    display: block;
    width: auto;
    height: 46px;
    margin-bottom: 28px;
}

.auth-title {
    margin: 0 0 10px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--auth-text);
    font-weight: 500;
    word-break: break-all;
}

/* Form controls */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-form label {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.auth-input,
.auth-password input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: var(--auth-field);
    border: 1px solid var(--auth-field-border);
    border-radius: var(--auth-radius-field);
    color: var(--auth-text);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder,
.auth-password input::placeholder {
    color: var(--auth-subtle);
}

.auth-input:focus,
.auth-password input:focus {
    outline: none;
    border-color: var(--auth-lime);
    box-shadow: 0 0 0 3px rgba(185, 230, 96, 0.22);
}

.auth-input--code {
    font-size: 24px;
    letter-spacing: 0.4em;
    text-align: center;
    text-transform: uppercase;
}

.auth-password {
    position: relative;
}

.auth-password input {
    padding-right: 54px;
}

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
    font-size: 18px;
    cursor: pointer;
}

.auth-password__toggle:hover {
    color: var(--auth-text);
}

.auth-hint {
    color: var(--auth-subtle);
    font-size: 13px;
    line-height: 1.45;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-form .auth-check {
    font-weight: 400;
    letter-spacing: 0;
}

.auth-check input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--auth-green);
}

.auth-optional {
    border: 1px solid var(--auth-field-border);
    border-radius: var(--auth-radius-field);
}

.auth-optional summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: var(--auth-muted);
    font-size: 14px;
    list-style: none;
    cursor: pointer;
}

.auth-optional summary::-webkit-details-marker {
    display: none;
}

.auth-optional summary .bi {
    transition: transform 0.15s;
}

.auth-optional[open] summary .bi {
    transform: rotate(180deg);
}

.auth-optional__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
}

.auth-captcha {
    min-height: 78px;
    overflow: hidden;
}

/* Buttons and links */

.auth-button {
    width: 100%;
    height: 54px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--auth-radius-field);
    background: var(--auth-green);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.2s, box-shadow 0.2s;
}

a.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-button:hover:not(:disabled) {
    background: var(--auth-green-hover);
}

/* Dimmed until the 18+/terms box is ticked */
.auth-button:disabled,
.auth-google:disabled {
    opacity: 0.38;
    filter: grayscale(0.5);
    cursor: not-allowed;
}

.auth-button[data-requires-agree]:not(:disabled) {
    box-shadow: 0 10px 28px rgba(8, 145, 58, 0.35);
}

/* Pops into place once the box is ticked */
.is-ready {
    animation: auth-pop 0.35s ease-out;
}

@keyframes auth-pop {
    0% { transform: scale(0.96); }
    55% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .is-ready {
        animation: none;
    }
}

.auth-button.is-busy,
.auth-google.is-busy {
    opacity: 0.7;
    filter: none;
    cursor: progress;
}

/* Google's dark-theme button */
.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 54px;
    border: 1px solid #8e918f;
    border-radius: var(--auth-radius-field);
    background: #131314;
    color: #e3e3e3;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.2s;
}

.auth-google:hover:not(:disabled) {
    background: #1f1f21;
}

.auth-google__logo {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--auth-subtle);
    font-size: 13px;
}

.auth-card > .auth-divider {
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-field-border);
}

.auth-agree-hint {
    margin: 0;
    text-align: center;
}

.auth-link,
.auth-text-button {
    color: var(--auth-lime);
    font-weight: 500;
    text-decoration: none;
}

.auth-link:hover,
.auth-text-button:hover:not([disabled]) {
    text-decoration: underline;
}

.auth-text-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.auth-text-button[disabled] {
    color: var(--auth-subtle);
    cursor: default;
}

.auth-link:focus-visible,
.auth-text-button:focus-visible,
.auth-button:focus-visible,
.auth-google:focus-visible,
.auth-password__toggle:focus-visible,
.auth-optional summary:focus-visible,
.auth-check input:focus-visible {
    outline: 2px solid var(--auth-lime);
    outline-offset: 2px;
}

.auth-switch {
    margin: 22px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

.auth-inline-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 20px;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-inline-actions form {
    display: inline;
}

/* Messages */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--auth-radius-field);
    font-size: 14px;
    line-height: 1.45;
}

.auth-alert .bi {
    margin-top: 1px;
}

.auth-alert--error {
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
}

.auth-alert--success {
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
}

/* Local test mode (php -S on this computer, no real backend) */
.auth-devbar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 540px;
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px dashed #c9a227;
    border-radius: var(--auth-radius-field);
    color: #f1d77a;
    font-size: 13px;
    line-height: 1.45;
}

.auth-alert--dev {
    border: 1px dashed #c9a227;
    background: rgba(201, 162, 39, 0.1);
    color: #f1d77a;
}

.auth-dev-code {
    font-size: 16px;
    letter-spacing: 0.2em;
    user-select: all;
}

.auth-note {
    display: flex;
    gap: 10px;
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--auth-field-border);
    color: var(--auth-subtle);
    font-size: 12.5px;
    line-height: 1.55;
}

.auth-note .bi {
    color: var(--auth-muted);
}

/* Welcome step: where things live */

.auth-guide {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.auth-guide li {
    display: flex;
    gap: 16px;
}

.auth-guide__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--auth-green);
    font-size: 18px;
}

.auth-guide h2 {
    margin: 2px 0 4px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.auth-guide p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Account page */

.auth-details {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 18px;
    margin: 0 0 22px;
    font-size: 14px;
}

.auth-details dt {
    color: var(--auth-muted);
}

.auth-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 14px;
}

.auth-section-title {
    margin: 26px 0 14px;
    padding-top: 22px;
    border-top: 1px solid var(--auth-field-border);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.auth-section-title + .auth-hint {
    margin: -6px 0 14px;
}

.auth-signout {
    margin-top: 22px;
    text-align: center;
}

/* Small screens: drop the image, keep the brand */

@media (max-width: 991.98px) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-visual {
        display: none;
    }

    .auth-main {
        justify-content: flex-start;
        padding: 24px 16px 40px;
    }

    .auth-mobile-brand {
        display: block;
        align-self: flex-start;
        margin: 0 0 20px 4px;
    }

    .auth-mobile-brand img {
        display: block;
        height: 38px;
    }

    .auth-card {
        padding: 30px 22px 28px;
        border-radius: 22px;
    }
}

/* The reCAPTCHA box is a fixed 304px wide; shrink it to fit narrow cards */
@media (max-width: 400px) {
    .auth-captcha {
        min-height: 70px;
    }

    .auth-captcha > div {
        transform: scale(0.9);
        transform-origin: left top;
    }
}

/* Platform chooser: pick a bookmaker before seeing plans (includes/platform-chooser.php) */

.platforms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin: 28px 0;
    padding: 0;
    list-style: none;
}

.platform__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--auth-field-border);
    border-radius: 20px;
    background: var(--auth-card);
    color: var(--auth-text) !important;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.platform__link:hover,
a.platform__link:focus-visible {
    transform: translateY(-3px);
    border-color: var(--auth-lime);
    box-shadow: 0 18px 50px rgba(8, 145, 58, 0.22);
}

a.platform__link:focus-visible {
    outline: 2px solid var(--auth-lime);
    outline-offset: 3px;
}

.platform__art {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 150px;
    padding: 18px 20px;
    background: var(--platform-bg);
    color: var(--platform-text);
}

/* St George's cross, on English leagues' cards */
.platform__flag {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 46px;
    height: 30px;
    border-radius: 4px;
    background:
        linear-gradient(#ce1124, #ce1124) center / 100% 6px no-repeat,
        linear-gradient(#ce1124, #ce1124) center / 6px 100% no-repeat,
        #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.platform__name {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.platform__league {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
}

.platform__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px 20px;
}

.platform__title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.platform__meta {
    color: var(--auth-muted);
    font-size: 14px;
}

.platform__cta {
    margin-top: auto;
    padding-top: 10px;
    color: var(--auth-lime);
    font-size: 15px;
    font-weight: 600;
}

.platform--paused .platform__link {
    opacity: 0.55;
}

.platform--paused .platform__cta {
    color: var(--auth-muted);
}

.platform-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--auth-muted) !important;
    font-size: 15px;
    text-decoration: none;
}

.platform-back:hover {
    color: var(--auth-lime) !important;
}
