/* Shield — auth / secondary pages (Telegram-like) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('/static/shield-theme.css');

:root {
    --tg-radius: 12px;
    --tg-radius-pill: 22px;
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    height: 100%;
    height: -webkit-fill-available;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: var(--tg-text);
    background: var(--tg-bg-chat);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding:
        max(16px, var(--sat))
        max(16px, var(--sar))
        max(16px, var(--sab))
        max(16px, var(--sal));
}

body.auth-page.native-webview {
    padding-top: max(36px, var(--sat));
}

.auth-shell {
    width: 100%;
    max-width: 400px;
    animation: authIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card {
    background: var(--tg-card);
    border-radius: var(--tg-radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 20px;
    background: var(--tg-header);
    border-bottom: 1px solid var(--tg-border);
}

.auth-brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--tg-bg);
    padding: 8px;
}

.auth-brand-title {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.auth-brand-sub {
    margin: 0;
    font-size: 14px;
    color: var(--tg-muted);
    text-align: center;
    max-width: 280px;
}

.auth-body {
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.auth-hint {
    margin: 0;
    font-size: 14px;
    color: var(--tg-muted);
    line-height: 1.45;
}

.auth-hint strong { color: var(--tg-text); font-weight: 500; }

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

.auth-label {
    font-size: 13px;
    color: var(--tg-muted);
    padding-left: 4px;
}

.auth-input {
    width: 100%;
    border: 0;
    border-radius: var(--tg-radius-pill);
    background: var(--tg-input-bg);
    color: var(--tg-text);
    padding: 12px 16px;
    min-height: 48px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    box-shadow: inset 0 0 0 1px var(--tg-border);
    transition: box-shadow 0.15s ease;
}

.auth-input::placeholder { color: var(--tg-muted); opacity: 0.85; }

.auth-input:focus {
    box-shadow: inset 0 0 0 2px var(--tg-accent);
}

.auth-input--code {
    text-align: center;
    font-size: 22px;
    letter-spacing: 0.35em;
    font-weight: 500;
}

.auth-segments {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--tg-input-bg);
    border-radius: var(--tg-radius-pill);
    box-shadow: inset 0 0 0 1px var(--tg-border);
}

.auth-segment {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--tg-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-segment.active {
    background: var(--tg-accent);
    color: #fff;
}

.auth-btn {
    width: 100%;
    border: 0;
    border-radius: var(--tg-radius-pill);
    background: var(--tg-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    padding: 13px 20px;
    min-height: 48px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.auth-btn:hover { filter: brightness(1.08); }

.auth-btn:active { transform: scale(0.98); }

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-btn--ghost {
    background: transparent;
    color: var(--tg-accent);
    min-height: auto;
    padding: 8px;
    font-size: 14px;
}

.auth-btn--ghost:hover { filter: none; background: var(--tg-hover); }

.auth-alert {
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    min-height: 1.2em;
    padding: 10px 12px;
    border-radius: 10px;
}

.auth-alert--error {
    color: #ffb4b4;
    background: rgba(232, 92, 92, 0.12);
}

.auth-alert--ok {
    color: #b8f0c8;
    background: rgba(92, 217, 122, 0.12);
}

.auth-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-bottom: 4px;
}

.auth-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tg-hover);
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-step-dot.active {
    background: var(--tg-accent);
    transform: scale(1.2);
}

.auth-step-dot.done { background: var(--tg-accent); opacity: 0.55; }

.auth-step-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 2px;
}

.auth-step-kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tg-accent);
}

.auth-step-title {
    margin: 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--tg-text);
}

.auth-back {
    align-self: flex-start;
    border: 0;
    background: transparent;
    color: var(--tg-muted);
    font-size: 14px;
    font-family: inherit;
    padding: 4px 0;
    margin: -4px 0 0;
    cursor: pointer;
}

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

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

.auth-note {
    margin: 0;
    font-size: 13px;
    color: var(--tg-muted);
    text-align: center;
}

.auth-note strong {
    color: var(--tg-text);
    font-weight: 500;
}

.auth-panel { display: none; flex-direction: column; gap: 14px; }

.auth-panel.active { display: flex; animation: authIn 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

.auth-foot {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
}

.auth-foot a {
    color: var(--tg-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-foot a:hover { text-decoration: underline; }

.auth-hidden { display: none !important; }

/* Standalone card pages (join, pin form) */
.auth-card--flat .auth-brand { padding-top: 22px; }

.auth-card--flat .auth-brand-mark { width: 56px; height: 56px; }

.auth-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 500;
}

/* Report page */
body.auth-report {
    justify-content: flex-start;
    padding-top: max(12px, var(--sat));
}

.auth-report-wrap {
    max-width: 900px;
    width: 100%;
}

.auth-report-card {
    background: var(--tg-card);
    border-radius: var(--tg-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.auth-report-card h1 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 500;
    color: var(--tg-text);
}

.auth-report-card .auth-btn,
.auth-report-card .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: auto;
    min-width: 120px;
}

.auth-report-grid {
    display: grid;
    gap: 10px;
}

.auth-report-row {
    background: var(--tg-input-bg);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px var(--tg-border);
}

.auth-report-key {
    color: var(--tg-accent);
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-word;
}

.auth-report-val {
    color: var(--tg-text);
    word-break: break-word;
    white-space: pre-wrap;
}
