:root {
  --white: #e6e6e6;
  --black: #1a1a1a;
  --gray-1: #4a4a4a;
  --gray-2: #6e6e6e;
  --line: #b8b8b8;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  background-color: var(--white);
  filter: contrast(1.15);
  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--black);
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  z-index: 1000;
}

.app { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.screen { display: none; }
.screen.active { display: block; }

h1 { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0.02em; color: var(--black); }
.lead { font-size: 13px; color: var(--gray-2); margin: 0 0 28px; line-height: 1.6; }

.btn {
  display: block; width: 100%; padding: 14px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.6); background: rgba(255,255,255,0.35);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 4px 16px rgba(0,0,0,0.06);
  font-size: 14px; font-weight: 600; color: var(--black); cursor: pointer; margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s; letter-spacing: 0.02em;
}
.btn:hover { border-color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.5); }
.btn.primary {
  background: #333333; color: var(--white); border-color: #333333;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.btn.primary:hover { opacity: 0.88; }

input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.6);
  font-size: 14px; margin-bottom: 10px; background: rgba(255,255,255,0.35);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5); color: var(--black);
}
input[type="text"]:focus { outline: 1px solid var(--black); border-color: var(--black); }

.field-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-2); margin: 0 0 6px; }

.error {
  font-size: 12px; color: var(--black); border-left: 2px solid var(--black);
  padding-left: 8px; margin: -4px 0 12px; display: none;
}

.card {
  width: 100%; aspect-ratio: 1.6 / 1; border-radius: 16px;
  background-image: url("card-bg.jpg");
  background-size: cover; background-position: center;
  position: relative; padding: 20px; color: var(--white); margin-bottom: 20px; overflow: hidden;
}
.card-top { display: flex; justify-content: flex-end; font-size: 11px; letter-spacing: 0.06em; color: #e6e6e6; }
.card-name {
  position: absolute; right: 20px; bottom: 78px; font-size: 16px; font-weight: 700; letter-spacing: 0.02em;
  text-align: right; color: #e6e6e6;
}
.card-serial {
  position: absolute; right: 20px; bottom: 54px; font-size: 12px; color: #e6e6e6;
  letter-spacing: 0.06em; text-align: right; font-weight: 600;
}
.card-date {
  position: absolute; right: 20px; bottom: 20px; font-size: 10px; color: #e6e6e6;
  text-align: right; font-weight: 600;
}

.mypage-actions { display: flex; gap: 8px; margin-bottom: 20px; }
.mypage-actions .btn { margin-bottom: 0; font-size: 13px; padding: 10px; }

.note {
  font-size: 12px; color: #333333; background: none; border: none;
  border-radius: 0; padding: 12px 0 0; line-height: 1.6; margin-top: 20px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none;
}
.note p { margin: 0 0 10px; }
.note p:last-child { margin-bottom: 0; }

.back { font-size: 11px; letter-spacing: 0.04em; color: var(--gray-2); margin-bottom: 16px; cursor: pointer; display: inline-block; }
.back:hover { color: var(--black); }
