/* 内定者向け 電子署名付き誓約書 */
:root {
  --primary: #1a4472;
  --primary-dark: #123456;
  --accent: #2d6a9f;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #2d3748;
  --muted: #64748b;
  --border: #d8e0ea;
  --success: #2e7d32;
  --error: #c62828;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 68, 114, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 1.5rem 1rem 1.75rem;
  text-align: center;
}

.site-header h1 {
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header p {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  opacity: 0.92;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.pledge-doc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #1a202c;
}

.pledge-doc .to-line { margin-bottom: 1.25rem; }

.pledge-doc .doc-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  margin: 0.5rem 0 1.25rem;
}

.pledge-doc .article {
  font-weight: 700;
  margin: 1rem 0 0.35rem;
}

.pledge-doc ul {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.75rem;
}

.pledge-doc li {
  padding-left: 1em;
  text-indent: -1em;
  margin-bottom: 0.35rem;
}

.pledge-doc .placeholder-note {
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  font-size: 0.82rem;
  color: var(--muted);
}

.pledge-doc .sig-on-doc {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.pledge-doc .sig-on-doc-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.pledge-doc .sig-on-doc-row .label {
  font-weight: 500;
  min-width: 3.5rem;
}

.pledge-doc .sig-on-doc-row .value-inline {
  flex: 1;
  min-width: 120px;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
  min-height: 1.4em;
}

.pledge-doc .sig-preview-box {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  height: 56px;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pledge-doc .sig-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group label .req {
  color: var(--error);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 68, 114, 0.12);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.checkbox-row input {
  margin-top: 0.25rem;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.sig-pad-wrap {
  border: 2px dashed var(--primary);
  border-radius: 10px;
  background: #fafcff;
  position: relative;
  touch-action: none;
}

.sig-pad-wrap canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
  cursor: crosshair;
}

.sig-pad-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
}

.sig-pad-wrap.has-signature .sig-pad-hint { display: none; }

.sig-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-clear-sig {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}

.btn-submit {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-msg {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.5em;
}

.status-msg.ok { color: var(--success); }
.status-msg.err { color: var(--error); }

.success-panel {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
}

.success-panel.show { display: block; }
.success-panel .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.success-panel a { color: var(--primary); word-break: break-all; }
.form-panel.hidden { display: none; }

@media (max-width: 480px) {
  .card { padding: 1.15rem; }
  .sig-pad-wrap canvas { height: 140px; }
  .pledge-doc .doc-title { letter-spacing: 0.2em; font-size: 1.1rem; }
}
