@charset "UTF-8";

/* ============================================================
   Akatsuki パートナー受発注 — 認証画面
   「朝」。白い紙のような地に、低い位置から暖かい光が差す。
   文字は置かない。屋号と、手を動かすための最小限だけ。
   外部リソースとインラインstyleはCSPで禁じているので、
   配色・質感・動きはすべてこのファイルの中で完結させる。
   ============================================================ */

:root {
    --paper: #f4f6f1;
    --card: #ffffff;
    --ink: #233832;
    --ink-dim: #5b6e66;
    --ink-faint: #8a998f;
    --line: #dde3da;
    --line-lit: #c2cec1;
    --green: #23584c;
    --green-deep: #173f35;
    --ember: #c8801f;
    --ember-soft: #f0c98a;
    --alert: #a0342a;
    --ui: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--ui);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }

/* ---- 舞台 ------------------------------------------------ */

.auth {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 48px 24px 88px;
    overflow: hidden;
    /* 上はわずかに緑を含んだ白、下へ行くほど暖かくなる */
    background:
        radial-gradient(120% 86% at 50% 4%, #f8faf5 0%, var(--paper) 58%),
        var(--paper);
}

/* 低い位置から差す朝の光。ゆっくり呼吸する */
.auth::before {
    content: "";
    position: absolute;
    left: -12%;
    right: -12%;
    bottom: 0;
    height: 58vmin;
    pointer-events: none;
    background:
        radial-gradient(72% 125% at 50% 116%,
            rgba(246, 199, 133, 0.66) 0%,
            rgba(238, 189, 124, 0.36) 22%,
            rgba(196, 214, 190, 0.16) 48%,
            transparent 74%);
    transform: translateX(var(--glow-shift, 0px));
    animation: dawn 26s ease-in-out infinite;
}

/* 地平線。読み込みで中心から左右へ引かれる */
.auth::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 9%;
    width: min(880px, 78vw);
    height: 1px;
    pointer-events: none;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    background: linear-gradient(90deg,
        transparent,
        rgba(200, 128, 31, 0.26) 14%,
        rgba(178, 106, 18, 0.6) 50%,
        rgba(200, 128, 31, 0.26) 86%,
        transparent);
    animation: horizon 1.6s 0.2s var(--ease) forwards;
}

/* 紙の目。のっぺりした面にわずかな肌理を足す */
.auth-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 光の中を漂う塵。白地なので、重ねて濃くする */
.auth-embers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
    opacity: 0.5;
}

@keyframes dawn {
    0%, 100% { opacity: 0.78; transform: translateX(var(--glow-shift, 0px)) scale(1); }
    50% { opacity: 1; transform: translateX(var(--glow-shift, 0px)) scale(1.07); }
}

@keyframes horizon {
    to { transform: translateX(-50%) scaleX(1); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes card {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

@keyframes stem {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* ---- 中身 ------------------------------------------------ */

/* 光と塵の上に文字が直接乗ると読みづらい。白い面を1枚敷く。 */
.auth-panel {
    position: relative;
    z-index: 2;
    width: min(424px, 100%);
    display: grid;
    gap: 28px;
    padding: 40px 34px 36px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow:
        0 34px 80px -46px rgba(35, 56, 50, 0.42),
        0 2px 6px -2px rgba(35, 56, 50, 0.06);
    animation: card 1s 0.12s var(--ease) both;
}

.auth-panel > * {
    opacity: 0;
    animation: rise 0.9s var(--ease) forwards;
}

.auth-panel > *:nth-child(1) { animation-delay: 0.35s; }
.auth-panel > *:nth-child(2) { animation-delay: 0.50s; }
.auth-panel > *:nth-child(3) { animation-delay: 0.60s; }
.auth-panel > *:nth-child(4) { animation-delay: 0.68s; }
.auth-panel > *:nth-child(5) { animation-delay: 0.76s; }
.auth-panel > *:nth-child(6) { animation-delay: 0.84s; }

/* 屋号。黒い筆文字をそのまま置ける */
.auth-mark {
    justify-self: center;
    display: grid;
    gap: 22px;
    justify-items: center;
}

.auth-mark img {
    width: 156px;
    height: auto;
}

/* 屋号から下へ伸びる一本の線。間を持たせるための所作 */
.auth-mark span {
    display: block;
    width: 1px;
    height: 34px;
    transform-origin: top;
    background: linear-gradient(180deg, var(--line-lit), transparent);
    animation: stem 0.8s 1s var(--ease) both;
}

.auth-form { display: grid; gap: 26px; }

.auth-form > * {
    opacity: 0;
    animation: rise 0.8s var(--ease) forwards;
}

.auth-form > *:nth-child(2) { animation-delay: 0.08s; }
.auth-form > *:nth-child(3) { animation-delay: 0.16s; }
.auth-form > *:nth-child(4) { animation-delay: 0.24s; }
.auth-form > *:nth-child(5) { animation-delay: 0.32s; }
.auth-form > *:nth-child(6) { animation-delay: 0.40s; }

/* 入力欄。見出しは欄の中に置き、書き始めると上へ逃がす。 */
.auth-field { position: relative; display: block; }

.auth-field input {
    width: 100%;
    padding: 25px 92px 10px 14px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--line-lit);
    border-radius: 5px 5px 0 0;
    background: #f7f9f4;
    color: var(--ink);
    font-size: 15.5px;
    letter-spacing: 0.02em;
    transition: background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.auth-field input::placeholder { color: transparent; }

.auth-field > span {
    position: absolute;
    left: 14px;
    top: 18px;
    font-size: 14px;
    color: var(--ink-dim);
    letter-spacing: 0.04em;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.28s var(--ease), color 0.28s var(--ease);
}

/* 書き始めたら、見出しは小さくなって上へ */
.auth-field input:focus ~ span,
.auth-field input:not(:placeholder-shown) ~ span {
    transform: translateY(-11px) scale(0.72);
    color: var(--green);
    letter-spacing: 0.18em;
}

.auth-field input:hover {
    background: #f2f5ee;
    border-bottom-color: #a9b8a8;
}

.auth-field input:focus {
    outline: none;
    background: #fff;
    border-bottom-color: var(--green);
    box-shadow: 0 1px 0 0 var(--green), 0 14px 30px -24px rgba(35, 88, 76, 0.7);
}

/* 確認コードは数字を大きく、字間を開けて読ませる */
.auth-field input.code {
    font-size: 30px;
    letter-spacing: 0.44em;
    text-align: center;
    padding: 30px 0 16px 0.44em;
    font-variant-numeric: tabular-nums;
}

.auth-field input.code ~ span {
    left: 50%;
    transform: translateX(-50%);
}

.auth-field input.code:focus ~ span,
.auth-field input.code:not(:placeholder-shown) ~ span {
    transform: translate(-50%, -10px) scale(0.72);
}

/* パスワードの表示切り替え */
.auth-reveal {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-dim);
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 5px 12px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.auth-reveal:hover { color: var(--ink); border-color: var(--line-lit); background: #f4f7f1; }

.auth-caps {
    margin: -14px 0 0;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: #8a5a10;
}

.auth-submit {
    position: relative;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--green);
    border-radius: 5px;
    background: var(--green);
    color: #fff;
    overflow: hidden;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.34em;
    text-indent: 0.34em;
    transition: border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.auth-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-101%);
    background: linear-gradient(90deg, var(--green-deep), #2c6b5c);
    transition: transform 0.55s var(--ease);
}

.auth-submit > span { position: relative; }

.auth-submit:hover, .auth-submit:focus-visible {
    border-color: var(--green-deep);
    box-shadow: 0 12px 26px -18px rgba(23, 63, 53, 0.9);
}

.auth-submit:hover::before, .auth-submit:focus-visible::before { transform: translateX(0); }

.auth-submit:focus-visible { outline: 3px solid var(--ember-soft); outline-offset: 2px; }

.auth-submit:disabled { cursor: progress; opacity: 0.75; }

.auth-submit.is-busy > span { opacity: 0.6; }

/* 控えめな二番手の操作 */
.auth-quiet {
    justify-self: center;
    border: 0;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink-dim);
    border-bottom: 1px solid transparent;
    text-decoration: none;
    transition: color 0.3s, border-color 0.3s;
}

.auth-quiet:hover { color: var(--ink); border-bottom-color: var(--line-lit); }

a { color: var(--green); text-underline-offset: 4px; }

a:hover { color: var(--green-deep); }

.auth-note {
    font-size: 12.5px;
    line-height: 2;
    color: var(--ink-dim);
    margin: 0;
}

.auth-note.center { text-align: center; }

.auth-error {
    font-size: 12.5px;
    line-height: 1.9;
    color: #8f2f25;
    background: #fdf1ef;
    border-left: 3px solid var(--alert);
    padding: 11px 14px;
    border-radius: 0 4px 4px 0;
}

.auth-status {
    font-size: 12.5px;
    line-height: 1.9;
    color: #3d5c4f;
    background: #eef4ee;
    border-left: 3px solid var(--green);
    padding: 11px 14px;
    border-radius: 0 4px 4px 0;
}

.auth-section {
    margin: 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--ink-dim);
}

.auth-head { display: grid; gap: 6px; justify-items: center; text-align: center; }

.auth-head b { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; }

.auth-head small { font-size: 11.5px; color: var(--ink-dim); letter-spacing: 0.04em; }

/* 二段階認証の登録まわり */
.auth-qr {
    justify-self: center;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    line-height: 0;
}

.auth-qr svg { width: 168px; height: 168px; display: block; }

.auth-key {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--green);
    word-break: break-all;
}

.auth-codes {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--ink);
}

details summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--ink-dim);
    padding: 8px 0;
    transition: color 0.3s;
}

details summary:hover, details[open] summary { color: var(--ink); }

/* 画面の隅に置く、読み込み位置の目印 */
.skip {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 12px;
    border-radius: 3px;
    transition: top 0.2s;
}

.skip:focus { top: 12px; }

/* ---- 小さい画面 ------------------------------------------ */

@media (max-width: 480px) {
    .auth { padding: 28px 14px 64px; }
    .auth-panel { padding: 32px 22px 30px; border-radius: 14px; }
    .auth::after { bottom: 7%; }
    .auth-mark img { width: 128px; }
    .auth-mark span { height: 26px; }
    .auth-field input.code { font-size: 22px; letter-spacing: 0.32em; }
    .auth-codes { grid-template-columns: 1fr; }
}

@media (max-height: 640px) {
    .auth::after { display: none; }
    .auth-mark span { display: none; }
}

/* ---- 動きを減らす設定のとき ------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .auth::before, .auth::after, .auth-panel, .auth-panel > *, .auth-form > *, .auth-mark span {
        animation: none;
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }
    .auth::before { transform: none; }
    .auth-panel, .auth-panel > *, .auth-form > *, .auth-mark span { transform: none; }
    * { transition-duration: 0.01ms !important; }
}
