/* public/style.css */

/* ---- base ---- */
:root{
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #222;
  --muted: #6b7280;

  /* 画像の黄色に寄せたアクセント */
  --accent: #f5c61c;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;

  /* 中央寄せ */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- title ---- */
h1{
  margin: 0 0 22px;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
}

/* ---- messages / download url area ---- */
p{
  width: min(900px, 100%);
  margin: 0 0 12px;
  color: var(--muted);
}

/* 「ダウンロードURL:」のリンクをボタン風に */
p a{
  display: block;
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  font-size: 20px;

  /* URLが長くても崩れないように */
  overflow-wrap: anywhere;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

p a:hover{ filter: brightness(.98); }
p a:active{ transform: translateY(1px); }

/* ---- card (form) ---- */
form{
  width: min(900px, 100%);
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* index.php にある <br><br> をレイアウト崩れ要因にしない */
form br{ display: none; }

/* email/password を同じ見た目にする */
input[type="email"],
input[type="password"],
input[type="text"]{
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  font-size: 16px;
  margin: 0 0 16px;
  outline: none;
  background: #fff;
}

input[type="email"]:focus,
input[type="password"]:focus{
  border-color: rgba(0,0,0,.32);
  box-shadow: 0 0 0 4px rgba(246,196,15,.28);
}


/* ファイル選択を“エリア”っぽく */
input[type="file"]{
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  border: 2px dashed rgba(0,0,0,.16);
  background: rgba(255,255,255,.9);
  margin: 0 0 18px;
  font-size: 16px;
}

input[type="file"]::file-selector-button{
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-right: 14px;
  background: rgba(246,196,15,.35);
  font-weight: 800;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover{
  background: rgba(246,196,15,.45);
}

/* 送信ボタンを大きく（文言はそのまま） */
button[type="submit"]{
  width: 100%;
  height: 72px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
}

button[type="submit"]:hover{ filter: brightness(.98); }
button[type="submit"]:active{ transform: translateY(1px); }

/* ---- separator ---- */
hr{
  width: min(900px, 100%);
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.10);
  margin: 20px 0 0;
}

/* ダウンロードURL + コピーボタン行 */
.download-copy-row{
  width: min(900px, 100%);
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin: 12px 0 18px;
}

#downloadUrl{
  flex: 1;
  height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  font-size: 16px;
  outline: none;
  background: #fff;
}

#downloadUrl:focus{
  border-color: rgba(0,0,0,.32);
  box-shadow: 0 0 0 4px rgba(246,196,15,.28);
}

.copy-btn{
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.copy-btn:disabled{
  opacity: .7;
  cursor: default;
}

/* フッターの著作権だけ中央寄せ */
p.copyright{
  text-align: center;
}

button[type="submit"].btn-download{
  background: #92d050;
  color: #222;
}
button[type="submit"].btn-download:hover{ filter: brightness(.95); }
button[type="submit"].btn-download:active{ transform: translateY(1px); }

/* ---- fixed header image (top-left) ---- */
.site-header{
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  display: block;
  line-height: 0;
}

.site-header img{
  display: block;
  height: 48px;   /* 好きな高さに固定（ここを変えれば全画面同じ） */
  width: auto;
}

/* ---- logout button (top-right) ---- */
.logout-btn{
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;

  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  text-decoration: none;
  font-weight: 900;
  display: inline-flex;
  align-items: center;

  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.logout-btn:hover{ filter: brightness(.98); }
.logout-btn:active{ transform: translateY(1px); }
.logout-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(246,196,15,.28), 0 6px 16px rgba(0,0,0,.08);
}


/* ---- topbar actions (top-right) ---- */
.topbar-actions{
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 既存logout-btnのfixedをこの中では無効化して横並び */
.topbar-actions .logout-btn{
  position: static;
  top: auto;
  right: auto;
}

.profile-btn{
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.profile-btn:hover{ filter: brightness(.99); }
.profile-btn:active{ transform: translateY(1px); }

/* ---- modal ---- */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 10000;
}
.modal-overlay.is-open{ display: flex; }

.modal-card{
  width: min(640px, 100%);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.08);
  padding: 18px;
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-title{
  font-weight: 900;
  font-size: 18px;
}

.modal-close{
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(0,0,0,.06);
  font-size: 22px;
  cursor: pointer;
}

.modal-form label{
  display:block;
  font-weight: 800;
  margin: 0 0 10px;
  color: #111;
}

.modal-actions{
  display:flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.modal-cancel{
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  font-weight: 900;
  cursor:pointer;
}

.modal-save{
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  font-weight: 900;
  cursor:pointer;
}
/* download success message */
.msg-success {
  color: #1f8a3a;
  font-weight: 900;
}
