/**
 * Inkeria UI kit (inkeria-otp 1.6.0) - style handle `inkeria-ui`.
 *
 * Shared building blocks for login, code and club signup ("Innmelding og
 * kode", Nov 2026). Tokens on :root plus generic .mp-* classes; nothing
 * outside these classes is styled. Font is inherited (Poppins on the shops).
 */

:root {
    --mp-pink: #C2255C;
    --mp-pink-tint: #FDEEF3;
    --mp-pink-border: #F3B9CD;
    --mp-green: #2F7D57;
    --mp-text: #2E2E2E;
    --mp-muted: #595959;
    --mp-border: #E7E3DE;
    --mp-input-border: #D9D4CD;
    --mp-danger: #B42318;
}

/* Buttons: pill, full width, 48 px. Colour via modifier. */
.mp-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--mp-green);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.mp-btn:hover:not(:disabled) {
    filter: brightness(0.93);
    color: #fff;
}

.mp-btn:focus-visible {
    outline: 2px solid var(--mp-text);
    outline-offset: 2px;
}

.mp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mp-btn--green {
    background: var(--mp-green);
}

.mp-btn--pink {
    background: var(--mp-pink);
}

/* Small head button (member module head): 44 px, auto width. */
.mp-btn--sm {
    display: inline-flex;
    width: auto;
    height: 44px;
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Label over a field */
.mp-label {
    display: block;
    margin: 0 0 6px;
    color: var(--mp-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

/* Text field */
.mp-field {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--mp-input-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mp-text);
    font-family: inherit;
    font-size: 15px;
    line-height: normal;
    box-shadow: none;
}

.mp-field:focus {
    outline: none;
    border-color: var(--mp-text);
    box-shadow: 0 0 0 1px var(--mp-text);
}

/* iOS zooms into fields under 16 px */
@media (max-width: 767px) {
    .mp-field {
        font-size: 16px;
    }
}

/* Help text */
.mp-help {
    margin: 0;
    color: var(--mp-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

/* Links (also on <button>) */
.mp-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--mp-pink);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.mp-link:hover {
    color: var(--mp-pink);
    text-decoration: underline;
    opacity: 0.85;
}

.mp-link--plain,
.mp-link--plain:hover {
    color: var(--mp-text);
}

/* Checkbox + consent text: <label class="mp-check"><input type="checkbox"><span>…</span></label> */
.mp-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--mp-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
}

.mp-check input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--mp-pink);
    cursor: pointer;
}

.mp-check a {
    color: var(--mp-pink);
    text-decoration: underline;
}

/* Error text (give it role="alert") */
.mp-error {
    margin: 0;
    color: var(--mp-danger);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
}

.mp-error[hidden] {
    display: none;
}

/* Code field: six cells over one invisible input (Inkeria_OTP_UI::code_field_html) */
.mp-otp {
    --otp-accent: var(--mp-green);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mp-otp[data-accent="member"] {
    --otp-accent: var(--mp-pink);
}

.mp-otp__label {
    display: block;
    margin: 0;
    color: var(--mp-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

.mp-otp__field {
    position: relative;
}

.mp-otp__cells {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.mp-otp__cells span {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: 1px solid var(--mp-input-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mp-text);
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mp-otp__input:focus + .mp-otp__cells span.is-active {
    border: 2px solid var(--otp-accent);
}

/* Error wins over the active cell, so all six cells turn red */
.mp-otp.has-error .mp-otp__cells span,
.mp-otp.has-error .mp-otp__input:focus + .mp-otp__cells span.is-active {
    border: 2px solid var(--mp-danger);
}

/* The real input lies invisibly over the cells and takes typing, paste and autofill */
.mp-otp__input,
.mp-otp__input:focus {
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    opacity: 0;
    cursor: text;
    -webkit-appearance: none;
    appearance: none;
}

.mp-otp__error {
    margin: 0;
    color: var(--mp-danger);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.mp-otp__error[hidden] {
    display: none;
}
