/* =========================================
   ツールページ共通パーツ（doc/デザイン.html 準拠）
   base.css の配色・角丸を前提に、ヒーロー・操作パーツ・FAQ・通知・ロード中・
   アップロードエリアの見た目と動きをそろえる。各ページの <style> より後に読み込む。
   ========================================= */
:root {
    --kit-line: #eee;
    --kit-safe-bg: #e6fffa;
    --kit-safe: #2c7a7b;
    --kit-safe-line: #b2f5ea;
    --kit-warning-bg: #fffaf0;
    --kit-warning: #c05621;
    --kit-warning-line: #fbd38d;
    --kit-danger-bg: #fff5f5;
    --kit-danger: #c53030;
    --kit-danger-line: #feb2b2;
    --kit-shadow-card: 0 10px 30px rgba(0, 0, 0, .05);
    --kit-shadow-result: 0 4px 10px rgba(0, 0, 0, .1);
}

/* ---------- ヒーロー：1列・左揃え。右側のカードは置かない ---------- */
.hero {
    padding: 36px 0 24px;
    overflow: visible;
    background: none;
}

.hero .hero-content {
    max-width: none;
    text-align: left;
}

.hero .badge {
    margin-bottom: 14px;
}

.hero .hero-title {
    margin: 0;
    font-size: clamp(34px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .02em;
}

.hero-copy {
    margin-top: 18px;
}

.hero-tagline {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}

.hero .hero-text {
    margin: 0;
    color: var(--text-sub);
    font-size: 15px;
    line-height: 1.9;
}

.hero .hero-text + .hero-text {
    margin-top: 8px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-actions .btn {
    text-decoration: none;
}

.phrase {
    display: inline-block;
}

/* ---------- ボタン ---------- */
button.btn,
button.mode-tab {
    font-family: inherit;
}

.btn {
    transition: transform .2s, box-shadow .2s, background-color .2s, color .2s, border-color .2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.btn:disabled {
    background: #eee;
    color: #888;
    border-color: #eee;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

:is(button, a, summary, input, select, textarea):focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}

/* ---------- 入力：テキストボックスとドロップダウンは高さ54px ---------- */
input.form-input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
select.form-input {
    height: 54px;
    padding-top: 0;
    padding-bottom: 0;
}

/* ---------- 切替タブ・プリセット ---------- */
.mode-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #eee;
}

.mode-tab {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 12px 5px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-sub);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.mode-tab:is(.active, [aria-pressed=true], [aria-selected=true]) {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    animation: preset-bounce .3s cubic-bezier(.4, 0, .2, 1);
}

.mode-tab:has(> input:checked) {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    animation: preset-bounce .3s cubic-bezier(.4, 0, .2, 1);
}

/* ラジオボタンをタブ型で見せるときは、入力本体を視覚的に隠す */
.mode-tab > input[type=radio] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.mode-tab:has(> input:focus-visible) {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

@media (hover: hover) {
    .mode-tab:hover {
        transform: scale(1.03);
    }
}

.mode-tab:active {
    transform: scale(.95);
    animation: none;
}

@keyframes preset-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ---------- チェックボックス（Uiverse.io by kyle1dev を改変）・ラジオ ---------- */
.check-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.check-row > input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.check-row .checkbox-wrapper {
    position: relative;
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    transition: transform .2s ease;
}

.check-row .checkbox-bg {
    position: absolute;
    inset: 0;
    border: 2px solid var(--primary-color);
    border-radius: 7px;
    background: #fff;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.check-row .checkbox-icon {
    position: absolute;
    inset: 0;
    width: 80%;
    height: 80%;
    margin: auto;
    color: #fff;
    transform: scale(0);
    transition: transform .2s ease;
}

.check-row .check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset .3s ease .1s;
}

.check-row > input:checked + .checkbox-wrapper .checkbox-bg {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.check-row > input:checked + .checkbox-wrapper .checkbox-icon {
    transform: scale(1);
}

.check-row > input:checked + .checkbox-wrapper .check-path {
    stroke-dashoffset: 0;
}

.check-row > input:checked + .checkbox-wrapper {
    animation: checkbox-bounce .3s cubic-bezier(.4, 0, .2, 1);
}

.check-row > input:disabled + .checkbox-wrapper {
    opacity: .45;
}

@media (hover: hover) {
    .check-row:hover .checkbox-wrapper {
        transform: scale(1.05);
    }
}

.check-row:active .checkbox-wrapper {
    transform: scale(.95);
}

.check-row > input:focus-visible + .checkbox-wrapper .checkbox-bg {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

@keyframes checkbox-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.radio-row .checkbox-wrapper,
.radio-row .checkbox-bg {
    border-radius: 50%;
}

.radio-row .checkbox-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
}

/* ---------- トグルスイッチ（Uiverse.io by ErzenXz を改変） ---------- */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    flex: 0 0 51.2px;
    width: 51.2px;
    height: 25.6px;
}

.toggle-switch > input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.toggle-switch-background {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--input-border);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06);
    transition: background-color .3s ease, box-shadow .3s ease;
}

.toggle-switch-handle {
    position: absolute;
    top: 3.2px;
    left: 3.2px;
    width: 19.2px;
    height: 19.2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.toggle-switch > input:checked + .toggle-switch-background {
    background: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--primary-hover);
}

.toggle-switch > input:checked + .toggle-switch-background .toggle-switch-handle {
    transform: translateX(25.6px);
}

@media (hover: hover) {
    .toggle-row:hover .toggle-switch-background {
        box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06), 0 0 0 4px var(--input-focus-ring);
    }
}

.toggle-row:active .toggle-switch-handle {
    transform: scale(.92);
}

.toggle-row:active .toggle-switch > input:checked + .toggle-switch-background .toggle-switch-handle {
    transform: translateX(25.6px) scale(.92);
}

.toggle-switch > input:focus-visible + .toggle-switch-background {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

/* ---------- スライダー：掴むと拡大し、離すと弾んで戻る ---------- */
input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: grab;
    accent-color: var(--primary-color);
    --range-progress: 50%;
    --handle-scale: 1;
    --handle-motion: transform .42s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}

input[type=range]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--primary-color) 0 var(--range-progress), #ddd var(--range-progress) 100%);
}

input[type=range]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--primary-color) 0 var(--range-progress), #ddd var(--range-progress) 100%);
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -7px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
    transform: scale(var(--handle-scale));
    transition: var(--handle-motion);
}

input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
    transform: scale(var(--handle-scale));
    transition: var(--handle-motion);
}

@media (hover: hover) {
    input[type=range]:hover {
        --handle-scale: 1.05;
    }
}

input[type=range].is-grabbing {
    cursor: grabbing;
    --handle-scale: 1.35;
    --handle-motion: transform .16s ease-out, box-shadow .2s ease;
}

input[type=range]:disabled {
    cursor: not-allowed;
    opacity: .5;
}

/* ---------- 使い方リスト・ファイル一覧 ---------- */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
}

.steps > li {
    counter-increment: step;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--kit-line);
}

.steps > li:last-child {
    border: 0;
}

.steps > li::before {
    content: counter(step, decimal-leading-zero);
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 800;
}

.steps strong {
    display: block;
    font-size: 14px;
}

.steps p {
    margin-top: 5px;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.8;
}

/* 完了ステータスの光沢（Uiverse.io by SelfMadeSystem を改変） */
.status-pill {
    position: relative;
    display: inline-block;
    overflow: hidden;
    isolation: isolate;
    padding: 4px 9px;
    border-radius: 4px;
    background: var(--kit-safe-bg);
    color: var(--kit-safe);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.wait {
    background: #eee;
    color: #666;
}

.status-pill.failed {
    background: var(--kit-danger-bg);
    color: var(--kit-danger);
}

.status-pill.complete {
    background: var(--primary-color);
    color: #fff;
}

.status-pill.complete::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, .95) 50%, transparent 75%);
    transform: translateX(-140%);
    animation: status-shine 3s ease-in-out infinite;
}

@keyframes status-shine {
    0%, 15% { transform: translateX(-140%); opacity: 0; }
    25% { opacity: 1; }
    55% { transform: translateX(140%); opacity: 1; }
    65%, 100% { transform: translateX(140%); opacity: 0; }
}

/* ---------- FAQ ---------- */
.faq-list {
    overflow: hidden;
    border: 1px solid var(--kit-line);
    border-radius: 16px;
    background: #fff;
    text-align: left;
}

.faq-list details {
    border-bottom: 1px solid var(--kit-line);
}

.faq-list details:last-child {
    border: 0;
}

.faq-list summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
    list-style: none;
    cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary .q {
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 18px;
}

.faq-list summary::after {
    content: "";
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    margin-left: auto;
    background: linear-gradient(#666, #666) center / 12px 2px no-repeat, linear-gradient(#666, #666) center / 2px 12px no-repeat;
}

.faq-list details[open] {
    background: var(--bg-light);
}

.faq-list details[open] summary::after {
    background: linear-gradient(#666, #666) center / 12px 2px no-repeat;
}

.faq-list .faq-a {
    margin: 0 24px 22px 52px;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.9;
}

.faq-list .faq-a > * + * {
    margin-top: 10px;
}

.faq-list .faq-a a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- ステータス・通知 ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.8;
}

.alert strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.alert > i {
    margin-top: 4px;
}

.alert.safe {
    border-color: var(--kit-safe-line);
    background: var(--kit-safe-bg);
    color: var(--kit-safe);
}

.alert.warning {
    border-color: var(--kit-warning-line);
    background: var(--kit-warning-bg);
    color: var(--kit-warning);
}

.alert.danger {
    border-color: var(--kit-danger-line);
    background: var(--kit-danger-bg);
    color: var(--kit-danger);
}

/* ---------- ロード中（Uiverse.io by satyamchaudharydev を改変） ---------- */
.loading-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100px;
    height: 100px;
}

.loading-bars.is-small {
    width: 44px;
    height: 32px;
    gap: 4px;
}

.loading-bars span {
    width: 4px;
    height: 50px;
    border-radius: 999px;
    background: var(--primary-color);
    animation: loading-wave .9s ease-in-out infinite;
}

.loading-bars.is-small span {
    width: 3px;
    height: 24px;
}

.loading-bars span:nth-child(2) { background: var(--accent-pink); animation-delay: -.8s; }
.loading-bars span:nth-child(3) { background: var(--accent-yellow); animation-delay: -.7s; }
.loading-bars span:nth-child(4) { background: var(--accent-pink); animation-delay: -.6s; }
.loading-bars span:nth-child(5) { background: var(--primary-color); animation-delay: -.5s; }

@keyframes loading-wave {
    0%, 40%, 100% { transform: scaleY(.05); }
    20% { transform: scaleY(1); }
}

/* ---------- アップロードエリア ---------- */
.upload-area-rich {
    padding: 30px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--kit-shadow-card);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, transform .2s;
}

.upload-area-rich:hover,
.upload-area-rich:is(.dragover, .dragging) {
    border-color: var(--primary-color);
    background: #e9faff;
}

.upload-area-rich:is(.dragover, .dragging) {
    transform: scale(1.005);
}

.upload-area-rich:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
}

.upload-area-rich .upload-icon {
    display: inline-block;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.upload-area-rich .drop-title {
    margin: 8px 0 0;
    color: var(--text-sub);
    font-size: 13px;
}

.upload-area-rich .btn {
    margin: 20px 0 4px;
}

.upload-area-rich .btn i {
    margin-right: 8px;
}

.upload-area-rich .upload-formats {
    margin: 8px 0 0;
    color: var(--text-sub);
    font-size: 13px;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid var(--kit-safe-line);
    border-radius: 8px;
    background: var(--kit-safe-bg);
    color: var(--kit-safe);
    font-size: 12px;
    text-align: left;
}

/* ファイル登録時の青い発光 */
.is-registered {
    animation: upload-flash 1s ease-out;
}

@keyframes upload-flash {
    0% { border-color: var(--primary-color); background: #e9faff; box-shadow: 0 0 0 0 rgba(0, 174, 239, .42); }
    45% { border-color: var(--primary-color); background: #f4fcff; box-shadow: 0 0 0 10px rgba(0, 174, 239, .16), 0 14px 36px rgba(0, 174, 239, .22); }
    100% { border-color: transparent; background: #fff; box-shadow: var(--kit-shadow-card); }
}

/* ---------- スマホ ---------- */
@media (max-width: 768px) {
    .hero {
        padding: 28px 0 20px;
    }

    .hero .hero-title {
        font-size: clamp(28px, 8.6vw, 36px);
    }

    .hero-tagline {
        font-size: 18px;
    }

    .hero .hero-text {
        font-size: 13px;
    }

    .faq-list summary {
        padding: 18px 16px;
    }

    .faq-list .faq-a {
        margin-right: 16px;
        margin-left: 44px;
    }

    .upload-area-rich {
        padding: 24px 16px;
    }
}

@media (max-width: 400px) {
    .privacy-badge {
        align-items: flex-start;
    }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .mode-tab,
    .check-row .checkbox-wrapper,
    .check-row .checkbox-bg,
    .check-row .checkbox-icon,
    .check-row .check-path,
    .toggle-switch-background,
    .toggle-switch-handle,
    .upload-area-rich {
        animation: none !important;
        transition: none !important;
    }

    .btn:hover,
    .btn:active,
    .mode-tab:hover,
    .mode-tab:active,
    .check-row:hover .checkbox-wrapper,
    .check-row:active .checkbox-wrapper {
        transform: none;
    }

    input[type=range] {
        --handle-motion: none;
    }

    .status-pill.complete::before {
        animation: none;
        opacity: 0;
    }

    .loading-bars span {
        animation: none;
        transform: scaleY(.45);
    }

    .is-registered {
        animation: none;
    }
}
