/* ============================================================
   place2charge · allauth pages (login, MFA, recovery codes)
   Gives allauth's plain element markup the look of auth_styles.css.
   Loaded after auth_styles.css by custom_auth/templates/allauth/layouts/base.html.
   ============================================================ */

.p2c-allauth h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}
.p2c-allauth h2 { font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.p2c-allauth h3 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }

.p2c-allauth p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-muted);
    margin: 0 0 14px;
}

.p2c-allauth label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.p2c-allauth input[type="email"],
.p2c-allauth input[type="password"],
.p2c-allauth input[type="text"],
.p2c-allauth input[type="number"],
.p2c-allauth input[type="tel"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: #F7FAFC;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.p2c-allauth input:focus {
    border-color: var(--ac);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(50,169,221,0.16);
}
/* 6-digit codes: large and spaced */
.p2c-allauth input[name="code"] {
    font-size: 22px;
    letter-spacing: 0.3em;
    text-align: center;
}
.p2c-allauth input[readonly] { color: var(--ink-muted); }

.p2c-allauth input[type="checkbox"] { margin-right: 6px; }

.p2c-allauth button,
.p2c-allauth input[type="submit"] {
    width: 100%;
    min-height: 46px;
    margin: 4px 0 10px;
    background: var(--grad-btn);
    background-size: 220% 100%;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-position 0.5s ease, box-shadow 0.2s;
    box-shadow: 0 6px 20px -6px rgba(0,78,145,0.45);
}
.p2c-allauth button:hover { background-position: 100% 50%; }
.p2c-allauth button:disabled { opacity: 0.6; cursor: default; }

/* Plain text button (sign out in the footer) */
.p2c-allauth .p2c-link-button {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
}
.p2c-allauth .p2c-link-button:hover { color: var(--ac); }

.p2c-allauth a { color: var(--primary); text-decoration: none; font-weight: 500; }
.p2c-allauth a:hover { color: var(--ac); }
.p2c-allauth hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.p2c-allauth ul { padding-left: 18px; font-size: 14px; color: var(--ink-muted); }
.p2c-allauth .errorlist { color: var(--danger); font-size: 12px; padding-left: 0; list-style: none; margin: -6px 0 10px; }
.p2c-allauth .helptext, .p2c-allauth small { font-size: 12px; color: var(--ink-subtle); }

/* Recovery codes (read-only textarea) and other textareas */
.p2c-allauth textarea {
    display: block;
    width: 100%;
    min-height: 210px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.08em;
    color: var(--ink);
    background: var(--primary-50);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    resize: none;
    outline: none;
}
.p2c-allauth textarea:focus { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(50,169,221,0.16); }

/* QR code of the authenticator setup */
.p2c-allauth img[src^="data:"] {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 8px auto 16px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* Recovery codes, passkey list */
.p2c-allauth pre,
.p2c-allauth code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    background: var(--primary-50);
    border-radius: 8px;
}
.p2c-allauth pre { padding: 12px 16px; line-height: 1.8; white-space: pre-wrap; }
.p2c-allauth table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.p2c-allauth th, .p2c-allauth td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.p2c-allauth td button { width: auto; min-height: 32px; padding: 0 12px; margin: 0; font-size: 12px; }

.p2c-allauth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Setup page: two options, each with an icon */
.p2c-mfa-options { display: grid; gap: 12px; margin-bottom: 18px; }
.p2c-mfa-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.p2c-mfa-option:hover { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(50,169,221,0.16); }
.p2c-mfa-option--recommended { border-color: var(--ac); }
.p2c-mfa-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    color: var(--primary);
}
.p2c-mfa-icon svg { width: 22px; height: 22px; }
.p2c-mfa-body { display: block; min-width: 0; }
.p2c-mfa-option--recommended .p2c-mfa-body { padding-right: 84px; }
.p2c-mfa-body strong { display: block; font-size: 15px; margin-bottom: 4px; }
.p2c-mfa-body > span { display: block; font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.p2c-mfa-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-100);
    padding: 3px 8px;
    border-radius: 12px;
}
@media (max-width: 460px) {
    .p2c-mfa-option--recommended .p2c-mfa-body { padding-right: 0; padding-top: 22px; }
}

/* Setup page: support contact with team faces */
.p2c-support {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--primary-50);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.p2c-support-text { font-size: 13px; line-height: 1.6; color: var(--ink-muted); }
.p2c-support-text strong { display: block; font-size: 14px; color: var(--ink); }
.p2c-support-text a { font-weight: 500; text-decoration: none; }
.p2c-support-text a:hover { color: var(--ac); }

.dash-action-team { display: inline-flex; flex-shrink: 0; }
.dash-action-team .dash-face {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    margin: 0 0 0 -8px;
    padding: 0;
    background: #fff;
}
.dash-action-team .dash-face:first-child { margin-left: 0; }
.dash-action-team .dash-face--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
}

/* Copyright line below the legal links */
.p2c-allauth .p2c-legal-mobile + .p2c-copy { margin-top: 14px; }

/* Login page: "or" divider and passkey button (outline variant of .p2c-submit) */
.p2c-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 12px;
    color: var(--ink-subtle);
}
.p2c-divider::before,
.p2c-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.p2c-submit--outline,
.p2c-allauth .p2c-submit--outline {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--border);
    box-shadow: none;
    gap: 8px;
}
.p2c-submit--outline:hover,
.p2c-allauth .p2c-submit--outline:hover {
    background: var(--primary-50);
    border-color: var(--ac);
    box-shadow: none;
}

/* Buttons that are links (continue, download): keep button colors, no underline */
.p2c-allauth a.p2c-submit { color: #fff; text-decoration: none; }
.p2c-allauth a.p2c-submit--outline { color: var(--primary); }
.p2c-allauth a.p2c-submit--outline:hover { color: var(--primary); }

/* Footer: sign-out stays on the right, also when there is no back link */
.p2c-allauth .p2c-allauth-logout { margin-left: auto; }

/* Recovery codes page */
.p2c-rc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}
.p2c-rc-actions .p2c-submit { margin: 0; gap: 8px; }
.p2c-allauth .p2c-continue {
    height: 54px;
    margin: 24px 0 4px;
    font-size: 15px;
}
.p2c-allauth .p2c-inline-label { display: inline; font-size: 13px; font-weight: 400; color: var(--ink-muted); }
@media (max-width: 460px) {
    .p2c-rc-actions { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------
   v1.1
   ------------------------------------------------------------------ */

/* No all-caps labels: small sentence-case line in the accent color */
.p2c-eyebrow,
.p2c-form-eyebrow {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 500;
}

/* Team faces in the left hero (login + MFA pages) */
.p2c-legal .p2c-legal-team { display: inline-flex; }
.p2c-legal .dash-face { border-color: var(--primary-100); }

/* "Choose a different method" above the setup forms */
.p2c-allauth .p2c-step-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--ink-subtle);
}
.p2c-allauth .p2c-step-back:hover { color: var(--primary); }

/* Success note after the setup */
.p2c-celebrate { align-items: flex-start; font-size: 14px; line-height: 1.5; }
.p2c-celebrate strong { font-weight: 600; }

/* Authenticator setup: numbered steps */
.p2c-steps { list-style: none; counter-reset: p2c-step; padding: 0; margin: 0 0 8px; }
.p2c-steps > li {
    position: relative;
    counter-increment: p2c-step;
    padding: 0 0 22px 40px;
}
.p2c-steps > li::before {
    content: counter(p2c-step);
    position: absolute;
    left: 0;
    top: -1px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.p2c-steps > li > strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.p2c-steps > li > span { display: block; font-size: 13px; color: var(--ink-muted); line-height: 1.5; margin-bottom: 10px; }
.p2c-allauth .p2c-steps img[src^="data:"] { margin: 6px 0 12px; width: 180px; }

/* "Can't scan?" disclosure with the key */
.p2c-secret summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    list-style: none;
}
.p2c-secret summary::-webkit-details-marker { display: none; }
.p2c-secret summary::after { content: " ›"; }
.p2c-secret[open] summary::after { content: " ‹"; }
.p2c-secret p { font-size: 13px; margin: 8px 0; }

/* Read-only field with a small copy button inside */
.p2c-copy-field { position: relative; }
.p2c-allauth .p2c-copy-field input {
    padding-right: 96px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    letter-spacing: 0.04em;
    margin-bottom: 0;
}
.p2c-allauth .p2c-copy-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
}
.p2c-allauth .p2c-copy-btn:hover { border-color: var(--ac); background: var(--primary-50); }

/* Code field of the authenticator setup */
.p2c-steps form input[name="code"] { margin-bottom: 10px; }

/* Network background stays in place on taller pages (MFA steps scroll) */
body > .p2c-geo { position: fixed; }

/* ------------------------------------------------------------------
   v1.2: sign-in methods overview
   ------------------------------------------------------------------ */
.p2c-methods { display: grid; gap: 12px; margin-bottom: 16px; }
.p2c-method {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
}
.p2c-method-body { min-width: 0; flex: 1; }
.p2c-method-body > strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.p2c-method-body > span { display: block; font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.p2c-method-status {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-bg);
    border-radius: 10px;
}
.p2c-method-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; font-size: 13px; }
.p2c-allauth .p2c-method-actions .p2c-method-remove { color: var(--ink-subtle); }
.p2c-allauth .p2c-method-actions .p2c-method-remove:hover { color: var(--danger); }

/* Trust page: second button below the first */
.p2c-allauth form .p2c-submit + .p2c-submit { margin-top: 0; }

/* ------------------------------------------------------------------
   v1.3
   ------------------------------------------------------------------ */

/* Logo left, small sign-out pill right (replaces the footer row) */
.p2c-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
}
.p2c-topbar-logo { height: 36px; width: auto; display: block; }
.p2c-topbar form { margin: 0; }
.p2c-allauth .p2c-signout {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-subtle);
}
.p2c-allauth .p2c-signout:hover { color: var(--primary); border-color: var(--ac); background: none; }

/* Recovery codes: 4 rows visible, the rest scrolls */
.p2c-allauth textarea#recovery_codes {
    min-height: 0;
    height: calc(4 * 1.8em + 28px);
    overflow-y: auto;
}

/* "Trust this browser for 30 days" at the end of the first setup */
.p2c-allauth label.p2c-trust {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin: 18px 0 0;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 400;
}
.p2c-allauth label.p2c-trust:hover { border-color: var(--ac); }
.p2c-trust input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.p2c-trust-title { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.p2c-trust small { display: block; color: var(--ink-muted); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
.p2c-allauth button.p2c-continue { height: 54px; margin: 24px 0 4px; font-size: 15px; }

/* Passkey buttons: fingerprint + USB key icon */
.p2c-passkey-icons { display: inline-flex; align-items: center; gap: 3px; margin-right: 2px; }

/* Small USB key badge on the passkey icon circle (setup page, overview) */
.p2c-mfa-icon { position: relative; }
.p2c-mfa-icon-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--primary-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.p2c-mfa-icon .p2c-mfa-icon-badge svg { width: 12px; height: 12px; }

/* Setup page title with shield icon */
.p2c-title-with-icon { display: flex; align-items: center; gap: 12px; }
.p2c-title-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-100);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.p2c-title-icon svg { width: 22px; height: 22px; }
