/* ============================================================
   Access Lounge - ビジュアルテーマ
   会員制ラウンジ×パスキー(鍵)のメタファー。
   チャコール×ローズ(#fb7185)を基調とした常時ダークテーマ。
   招待受諾/ログイン画面は "キーカード(搭乗券)" の切り取り線モチーフを差し色に使う。
   ============================================================ */

:root {
    --al-ink: #14181f;
    --al-ink-deep: #0e1116;
    --al-panel: #1c222c;
    --al-panel-2: #242b37;
    --al-accent: #fb7185;
    --al-accent-bright: #fda4af;
    --al-mist: #8a93a3;
    --al-paper: #eef0f3;
    --al-success: #6fbf8b;
    --al-danger: #d9736a;
    --al-divider: #2c3441;
}

html, body {
    background-color: var(--al-ink);
    color: var(--al-paper);
}

::selection {
    background: rgba(251, 113, 133, 0.35);
    color: var(--al-paper);
}

:focus-visible {
    outline: 2px solid var(--al-accent);
    outline-offset: 2px;
}

/* ---------- ブランド ---------- */

.al-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.al-brand--static {
    cursor: default;
}

.al-brand-icon {
    color: var(--al-accent);
}

.al-wordmark {
    font-family: "Fraunces", serif;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    color: var(--al-paper);
}

/* ---------- AppBar / Drawer ---------- */

.al-appbar {
    background-color: var(--al-panel-2) !important;
    border-bottom: 1px solid var(--al-divider);
}

.al-user-chip {
    font-family: "Noto Sans JP", sans-serif;
}

.al-drawer {
    border-right: 1px solid var(--al-divider);
}

.al-nav-section {
    display: block;
    padding: 1.25rem 1rem 0.4rem;
    color: var(--al-accent);
    letter-spacing: 0.12em;
}

.al-content {
    padding-bottom: 4rem;
}

/* ---------- フォーカスレイアウト (ログイン/招待受諾/初期セットアップ) ---------- */

.al-focus-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 15% -10%, rgba(251, 113, 133, 0.10), transparent 45%),
        radial-gradient(circle at 85% 110%, rgba(126, 168, 201, 0.08), transparent 45%),
        var(--al-ink);
}

.al-focus-topbar {
    padding: 1.5rem 2rem;
}

.al-focus-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
}

/* ---------- キーカード (シグネチャー要素) ---------- */

.al-keycard {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    width: 100%;
    max-width: 760px;
    background: var(--al-panel);
    border-radius: 18px;
    box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(251, 113, 133, 0.08);
    overflow: visible;
}

.al-keycard-main {
    padding: 2.75rem 2.75rem 2.5rem;
    min-width: 0;
}

.al-keycard-stub {
    position: relative;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    border-left: 2px dashed rgba(251, 113, 133, 0.32);
}

.al-keycard-stub::before,
.al-keycard-stub::after {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    left: -15px;
    background: var(--al-ink);
    border-radius: 50%;
}

.al-keycard-stub::before {
    top: -14px;
}

.al-keycard-stub::after {
    bottom: -14px;
}

.al-keycard-stub-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--al-mist);
    text-transform: uppercase;
}

.al-keycard-stub-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
    color: var(--al-paper);
}

@media (max-width: 640px) {
    .al-keycard {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .al-keycard-stub {
        border-left: none;
        border-top: 2px dashed rgba(251, 113, 133, 0.32);
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .al-keycard-stub::before,
    .al-keycard-stub::after {
        left: auto;
        top: -15px;
    }

    .al-keycard-stub::before {
        left: -14px;
    }

    .al-keycard-stub::after {
        right: -14px;
        left: auto;
    }
}

/* ---------- 単票カード (ログイン/初期セットアップ等) ---------- */

.al-card {
    width: 100%;
    max-width: 440px;
    background: var(--al-panel);
    border-radius: 18px;
    padding: 2.75rem;
    box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(251, 113, 133, 0.08);
}

/* ---------- ステップインジケーター ---------- */

.al-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.al-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--al-mist);
}

.al-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    border: 1.5px solid var(--al-divider);
    color: var(--al-mist);
    flex-shrink: 0;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.al-step.is-active .al-step-dot {
    border-color: var(--al-accent);
    color: var(--al-ink);
    background: var(--al-accent);
}

.al-step.is-done .al-step-dot {
    border-color: var(--al-accent);
    color: var(--al-accent);
    background: transparent;
}

.al-step-label {
    font-size: 0.85rem;
    white-space: nowrap;
}

.al-step.is-active .al-step-label {
    color: var(--al-paper);
}

.al-step-connector {
    flex: 1;
    height: 1px;
    background: var(--al-divider);
    min-width: 16px;
}

/* ---------- ボタン / CTA ---------- */

.al-cta.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--al-accent-bright), var(--al-accent));
    color: var(--al-ink);
}

@media (prefers-reduced-motion: no-preference) {
    .al-cta.mud-button-filled-primary {
        transition: filter 0.2s ease, transform 0.2s ease;
    }

    .al-cta.mud-button-filled-primary:hover {
        filter: brightness(1.08);
        transform: translateY(-1px);
    }
}

/* ---------- 招待/認証コード類のモノスペース表示 ---------- */

.al-mono {
    font-family: "JetBrains Mono", monospace !important;
    letter-spacing: 0.02em;
}

/* ---------- ホーム ---------- */

.al-hero {
    padding: 3rem 0 2rem;
}

.al-hero-eyebrow {
    font-family: "JetBrains Mono", monospace;
    color: var(--al-accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* ログイン後のリダイレクト演出 */
.al-redirect-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 17, 22, 0.88);
    backdrop-filter: blur(6px);
    animation: al-fade-in 0.25s ease-out;
}

.al-redirect-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 24px;
    max-width: 360px;
}

.al-redirect-orbit {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.al-redirect-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--al-divider);
    border-top-color: var(--al-accent);
    animation: al-spin 0.9s linear infinite;
}

.al-redirect-check {
    animation: al-pop 0.4s ease-out;
}

.al-redirect-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--al-mist);
}

.al-redirect-steps .is-done { color: var(--al-success); }
.al-redirect-steps .is-active { color: var(--al-accent-bright); animation: al-pulse 1.2s ease-in-out infinite; }

.al-redirect-sep {
    width: 16px;
    height: 1px;
    background: var(--al-divider);
}

@keyframes al-spin { to { transform: rotate(360deg); } }
@keyframes al-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes al-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes al-pulse { 50% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
    .al-redirect-ring, .al-redirect-check, .al-redirect-steps .is-active { animation: none; }
}

/* 簡易ログイン パターン入力 */
.al-pattern-pad { width: 100%; max-width: 300px; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.al-pattern-rubber { stroke: var(--mud-palette-primary); stroke-width: 8; stroke-linecap: round; opacity: .45; pointer-events: none; }
.al-pattern-dot { fill: var(--mud-palette-lines-inputs); cursor: pointer; transition: r .12s; }
.al-pattern-dot.used { fill: var(--mud-palette-primary); }
.al-pattern-dot.pending { fill: var(--mud-palette-secondary); }
.al-pattern-line { stroke: var(--mud-palette-primary); stroke-width: 8; stroke-linecap: round; cursor: pointer; }
