/* ICB Yazılım — claim sayfası
 * Apple Human Interface Guidelines'tan ilham, sade ve generous spacing.
 *
 * Design tokens (renk, radius, shadow, transition) tokens.css'te.
 */
@import url("tokens.css");

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  margin-bottom: 32px;
}

.brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 17px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* ---- Card ---- */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

/* ---- Fields ---- */
.field {
  margin-bottom: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-row .field {
  margin-bottom: 22px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text);
}

.optional {
  font-weight: 400;
  color: var(--color-text-tertiary);
  font-size: 13px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

input::placeholder {
  color: var(--color-text-tertiary);
}

/* Username + suffix combo */
.input-with-suffix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-with-suffix:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.input-with-suffix input {
  border: none;
  flex: 1;
  border-radius: 0;
  background: transparent;
}

.input-with-suffix input:focus {
  box-shadow: none;
}

.suffix {
  padding: 12px 14px;
  background: #f5f5f7;
  color: var(--color-text-tertiary);
  border-left: 1px solid var(--color-border);
  font-size: 14px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ---- Help tooltips ---- */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #f0f0f3;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-tertiary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  margin-left: 4px;
  cursor: help;
  user-select: none;
  position: relative;
  vertical-align: middle;
}

.help-trigger:hover,
.help-trigger:focus-visible {
  background: var(--color-text-tertiary);
  color: white;
  border-color: var(--color-text-tertiary);
  outline: none;
}

.help-trigger:hover::after,
.help-trigger:focus::after,
.help-trigger:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 12px;
  background: #1d1d1f;
  color: white;
  font-size: 12px;
  font-weight: 400;
  border-radius: 8px;
  white-space: normal;
  width: 260px;
  z-index: 10;
  line-height: 1.5;
  text-align: left;
  pointer-events: none;
  box-shadow: var(--shadow-tooltip);
}

.help-trigger:hover::before,
.help-trigger:focus::before,
.help-trigger:focus-visible::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1d1d1f;
  z-index: 10;
  pointer-events: none;
}

/* ---- Field status messages ---- */
.field-status {
  margin-top: 6px;
  font-size: 13px;
  min-height: 18px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

.field-status.success { color: var(--color-success); }
.field-status.error { color: var(--color-error); }
.field-status.info { color: var(--color-text-tertiary); }

/* ---- Username suggestions ---- */
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.suggestion-btn {
  padding: 6px 14px;
  background: #f5f5f7;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.suggestion-btn:hover {
  background: #e8e8ed;
  border-color: var(--color-border-strong);
}

/* Inline link-style suggestion (used in field-status for email typo fix) */
.inline-suggest-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0 2px;
  color: var(--color-accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.inline-suggest-btn:hover {
  color: var(--color-accent-hover);
}

/* ---- Consent ---- */
.consent-field {
  margin: 28px 0 24px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
  font-weight: 400;
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.checkbox-label a {
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* ---- Primary button ---- */
.primary-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  text-align: center;
  text-decoration: none;
}

.primary-btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.primary-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.primary-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Form error banner ---- */
.form-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--color-error-soft);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-sm);
  color: var(--color-error);
  font-size: 14px;
  line-height: 1.5;
}

.form-error a {
  color: var(--color-error);
  font-weight: 500;
}

/* ---- Footer ---- */
.page-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.page-footer a {
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

/* ---- Success screen ---- */
.success-card {
  text-align: center;
}

.check-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--color-success);
  border-radius: 50%;
  color: white;
  font-size: 32px;
  line-height: 56px;
  font-weight: 600;
}

.success-card h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.success-card > p {
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  font-size: 15px;
  line-height: 1.5;
}

.credential-box {
  text-align: left;
  background: #f5f5f7;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.credential {
  margin-bottom: 18px;
}

.credential:last-child {
  margin-bottom: 0;
}

.credential-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.credential-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.credential-value code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
  background: var(--color-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  flex: 1;
  word-break: break-all;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.copy-btn {
  padding: 10px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.copy-btn:hover {
  background: #f0f0f3;
  border-color: var(--color-border-strong);
}

.copy-btn.copied {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.setup-link {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.setup-link a {
  text-decoration: none;
}

.setup-link a:hover {
  text-decoration: underline;
}

.email-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* ---- Modal dialog (email typo confirmation) ---- */
dialog.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 420px;
  width: calc(100vw - 32px);
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  /* Centering: inset:0 + margin:auto centers the dialog both axes
     in the top-layer rendering context. Browsers vary on default
     positioning of <dialog>, so we set it explicitly. */
  inset: 0;
  margin: auto;
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  padding: 28px 28px 24px;
  text-align: center;
}

.modal-content h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.modal-text {
  color: var(--color-text-tertiary);
  font-size: 13px;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.modal-suggestion-text {
  margin-top: 14px;
}

.modal-email-row {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.modal-email-row code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  word-break: break-all;
}

.modal-email-typed {
  background: var(--color-error-soft);
}

.modal-email-typed code {
  color: var(--color-error);
}

.modal-email-suggestion {
  background: var(--color-accent-soft);
}

.modal-email-suggestion code {
  color: var(--color-accent);
  font-weight: 500;
}

.modal-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 20px 0 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 10px 8px;
  text-decoration: underline;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.link-btn:hover {
  color: var(--color-text);
}

/* ---- Mobile tweaks ---- */
@media (max-width: 600px) {
  .container { padding: 32px 16px 56px; }
  .card { padding: 24px 20px; }
  .hero h1 { font-size: 26px; }
  .subtitle { font-size: 15px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field { margin-bottom: 22px; }
  .help-trigger:hover::after,
  .help-trigger:focus::after,
  .help-trigger:focus-visible::after {
    width: 200px;
  }
}
