/* ============================================================
   CleanReceive — 共通スタイル
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- CSS変数 ---- */
:root {
  --color-bg:          #ffffff;
  --color-text:        #111827;
  --color-text-sub:    #6b7280;
  --color-accent:      #1a73e8;
  --color-accent-dark: #1250c4;
  --color-accent-bg:   #e8f0fe;
  --color-download:    #16a34a;
  --color-download-dk: #15803d;
  --color-error:       #dc2626;
  --color-error-bg:    #fef2f2;
  --color-border:      #e5e7eb;
  --color-disabled:    #9ca3af;
  --color-disabled-bg: #f3f4f6;
  --radius-sm:         6px;
  --radius-md:         10px;
  --radius-lg:         20px;
  --shadow-sm:         0 1px 3px rgba(0,0,0,.08);
  --shadow-md:         0 4px 12px rgba(0,0,0,.10);
}

/* ---- ベース ---- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans',
               'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
  background: #dde8f8;
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 10%, rgba(180,210,255,0.7) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(160,200,255,0.5) 0%, transparent 60%),
    linear-gradient(160deg, #cfe0f8 0%, #e8f0fc 40%, #d8eaff 100%);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---- レイアウト ---- */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* ---- ヘッダー ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.875rem 0;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.7);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--color-text); }

.logo-svg {
  display: block;
  flex-shrink: 0;
}

.tagline {
  font-size: 0.8125rem;
  color: var(--color-text-sub);
  display: none;
}
@media (min-width: 480px) { .tagline { display: block; } }

/* ---- ガラスカード ---- */
.glass-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.9) inset,
    0 12px 48px rgba(100,160,255,0.12),
    0 2px 8px rgba(0,0,0,0.04);
  padding: 2rem;
}

/* ---- ヒーロー ---- */
.hero-copy {
  font-size: clamp(1.875rem, 5vw, 2.625rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-align: center;
  color: #0f1c35;
  margin-bottom: 0.625rem;
}

.hero-sub {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ---- ページタイトル（他ページ用） ---- */
.page-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.375rem;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  margin-bottom: 1.5rem;
}

/* ---- ファイルドロップエリア ---- */
.drop-zone {
  border: 1.5px dashed rgba(26,115,232,0.3);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.4);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  position: relative;
  margin-bottom: 1.25rem;
}

.drop-zone:hover,
.drop-zone:focus-within {
  border-color: var(--color-accent);
  background: rgba(232,240,254,0.5);
}

.drop-zone.dragover {
  border-color: var(--color-accent);
  background: rgba(232,240,254,0.6);
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.1);
}

.drop-zone.has-file {
  border-color: var(--color-accent);
  background: rgba(232,240,254,0.4);
  border-style: solid;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-icon {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.drop-zone-primary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.drop-zone-secondary {
  font-size: 0.8125rem;
  color: var(--color-text-sub);
}

.drop-zone-file-info {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-accent);
  word-break: break-all;
}

.drop-zone-file-size {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-sub);
  margin-top: 0.125rem;
}

/* ---- オプションカード ---- */
.options-card {
  padding: 0;
  overflow: hidden;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.375rem;
  gap: 1rem;
}
.option-row + .option-row {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.option-left { flex: 1; }

.option-label-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.option-hint-text {
  font-size: 0.75rem;
  color: var(--color-text-sub);
  margin-top: 0.1rem;
}

/* ---- トグルスイッチ ---- */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 9999px;
  transition: background 0.2s;
  display: block;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--color-accent);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.2s;
  display: block;
}
.toggle-switch input:checked ~ .toggle-thumb {
  transform: translateX(18px);
}

/* ---- フォーム要素 ---- */
.form-group { margin-top: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.form-select,
.option-select {
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--color-text);
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 0.5rem;
  padding: 0.35rem 2rem 0.35rem 0.65rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  cursor: pointer;
  outline: none;
}
.form-select { width: 100%; padding: 0.625rem 2.5rem 0.625rem 0.875rem; }
.form-select:focus,
.option-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

/* ---- ボタン ---- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.8rem 1.5rem;
  font-size: 0.9875rem;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4d97f5 0%, #1a73e8 45%, #1250c4 100%);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 20px rgba(26,115,232,0.35);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 10px 28px rgba(26,115,232,0.42);
  text-decoration: none;
}
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled {
  background: linear-gradient(135deg, #a0bde8, #8baed4);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:focus-visible {
  outline: 3px solid rgba(26,115,232,0.5);
  outline-offset: 2px;
}

/* ダウンロードボタン（緑） */
.btn-download {
  display: block;
  width: 100%;
  padding: 1.0rem 1.5rem;
  font-size: 1.0625rem;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--color-download);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(22,163,74,.3);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.btn-download:hover {
  background: var(--color-download-dk);
  box-shadow: 0 8px 24px rgba(22,163,74,.35);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-download:active { transform: scale(0.99); }
.btn-download:focus-visible {
  outline: 3px solid rgba(22,163,74,0.5);
  outline-offset: 2px;
}

/* コピーボタン */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-copy:hover { background: var(--color-accent); color: #fff; }
.btn-copy.copied {
  background: #dcfce7;
  color: var(--color-download);
  border-color: var(--color-download);
}

/* ---- 進捗バー ---- */
.progress-wrapper { margin-top: 1.25rem; display: none; }
.progress-wrapper.visible { display: block; }

.progress-label {
  font-size: 0.875rem;
  color: var(--color-text-sub);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4d97f5, #1a73e8);
  border-radius: 999px;
  transition: width 0.2s ease;
  width: 0%;
}

/* ---- エラーメッセージ ---- */
.error-message {
  display: none;
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.error-message.visible { display: block; }

/* ---- 受信リンク表示 ---- */
.receive-link-box {
  background: var(--color-accent-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  margin-top: 0.5rem;
}
.receive-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.receive-link-url {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-accent-dark);
  word-break: break-all;
  font-weight: 500;
  line-height: 1.4;
}

/* ---- ファイル情報カード ---- */
.file-info-card {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  margin-top: 1.25rem;
}
.file-info-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
  word-break: break-all;
  margin-bottom: 0.5rem;
}
.file-info-meta {
  font-size: 0.875rem;
  color: var(--color-text-sub);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.file-info-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ---- 受信ページ専用 ---- */
.receive-file-name {
  font-size: 1.375rem;
  font-weight: 700;
  word-break: break-all;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.3;
}
.receive-file-meta {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.75rem;
}
.receive-file-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ---- スピナー ---- */
.spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,0,0,0.08);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ---- 広告スロット（非表示） ---- */
.ad-slot { display: none; }
.ad-notice { display: none; }

/* ---- セパレータ ---- */
.section-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.07);
  margin: 1.75rem 0;
}

/* ---- フィーチャー ---- */
.features {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  padding: 1.75rem 0 0.5rem;
  flex-wrap: wrap;
}
.feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}
.feature-check {
  width: 18px;
  height: 18px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(26,115,232,0.3);
}

/* ---- フッター ---- */
.footer {
  border-top: 1px solid rgba(255,255,255,0.5);
  padding: 1.25rem 0;
  margin-top: auto;
  background: rgba(255,255,255,0.3);
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-copy {
  font-size: 0.72rem;
  color: var(--color-text-sub);
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.72rem;
  color: var(--color-text-sub);
  text-decoration: none;
}
.footer-links a:hover { color: var(--color-text); }

/* 旧フッタースタイル（後方互換） */
.footer-text {
  font-size: 0.72rem;
  color: var(--color-text-sub);
}

/* ---- ステータスバッジ ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: var(--color-download); }

/* ---- エラーページ ---- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  min-height: 50dvh;
}
.error-page-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.error-page-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.error-page-body {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ---- 完了ページ ---- */
.success-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }

/* ---- 別ファイルリンク ---- */
.another-link {
  display: block;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-accent);
  margin-top: 1.5rem;
  padding: 0.5rem;
}

/* ---- スクリーンリーダー専用 ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ---- doc pages (terms/privacy/contact) ---- */
.doc-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}
.doc-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.doc-updated {
  font-size: 0.875rem;
  color: var(--color-text-sub);
  margin-bottom: 2.5rem;
}
.doc-section { margin-bottom: 2rem; }
.doc-section h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.doc-section p,
.doc-section li {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.doc-section ul { padding-left: 1.25rem; }
.doc-section li { margin-bottom: 0.25rem; }
.operator-box {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 10px;
  padding: 1.125rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* ---- レスポンシブ ---- */
@media (max-width: 560px) {
  .footer .container { flex-direction: column; align-items: flex-start; }
  .features { gap: 1.25rem; }
}
