/* ===== Basit Tasarım ===== */
:root{
  --bg: #f6f7f9;
  --fg: #0f172a;
  --muted: #6b7280;

  --card-bg: #ffffff;
  --line: #e5e7eb;

  --primary: #2563eb;
  --danger:  #dc2626;
  --success: #16a34a;

  --r-card: 12px;
  --r-ctl: 10px;

  --shadow: 0 6px 18px rgba(0,0,0,0.06);

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1220;
    --fg: #e5e7eb;
    --muted: #9aa1ac;

    --card-bg: #111827;
    --line: #1f2937;

    --shadow: 0 6px 18px rgba(0,0,0,0.25);
  }
}

*{ box-sizing: border-box }
html, body{ height: 100% }
body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container{ max-width: 820px; margin: 0 auto; padding: 24px; }
.header{ text-align: center; margin-bottom: 20px; }
.title{ margin: 0; font-weight: 700; font-size: clamp(24px, 3.4vw, 32px); }
.subtitle{ margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.card{
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ===== Formlar ===== */
.form-group{ margin-bottom: 16px; }
.label{ display: block; margin-bottom: 8px; font-weight: 600; }

.input-text,
.input-file,
.select{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: #fff;
  color: var(--fg);
  outline: none;
}

@media (prefers-color-scheme: dark){
  .input-text,
  .input-file,
  .select{
    background: #0f172a;
  }
}

.input-text:focus,
.input-file:focus,
.select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Select oku */
.select{
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%238b8f98' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* File input (webkit) */
.input-file::-webkit-file-upload-button{
  margin-right: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.input-file::-webkit-file-upload-button:hover{ filter: brightness(0.95); }

/* Küçük açıklama metni */
.hint{ font-size: 12px; color: var(--muted); margin-top: 6px; }
.hint.small{ font-size: 11px; }

/* ===== Butonlar ===== */
.actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 14px 0 6px;
}

.btn{
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.btn:disabled{ opacity: .6; cursor: not-allowed; }

.btn-primary{ background: var(--primary); }
.btn-primary:hover{ filter: brightness(0.95); }

.btn-danger{ background: var(--danger); }
.btn-danger:hover{ filter: brightness(0.95); }

.btn-success{ background: var(--success); }
.btn-success:hover{ filter: brightness(0.95); }

.hidden{ display: none !important; }

/* ===== Yükleme & Uyarılar ===== */
.loading{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin: 12px 0;
}
.spinner{
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.loading-title{ font-weight: 700; }
.loading-sub{ color: var(--muted); font-size: 13px; }

.alert{
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line);
}
.alert-error{ background: #fee2e2; color: #7f1d1d; }
.alert-success{ background: #dcfce7; color: #14532d; }

@media (prefers-color-scheme: dark){
  .alert-error{ background: #451a1a; color: #fecaca; }
  .alert-success{ background: #153d2a; color: #bbf7d0; }
}

/* Hata içinde yeni anahtar kutusu */
.newkey-box{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.newkey-row{
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== Çıktı ===== */
.output{
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 8px;
  text-align: center;
}
.output-title{ margin: 0 0 10px 0; font-size: 16px; font-weight: 700; }
.audio{ width: 100%; border-radius: 8px; outline: none; }

/* ===== Alt Bilgi ===== */
.footer{ margin-top: 22px; color: var(--muted); font-size: 13px; }
.footer-title{ font-weight: 700; margin-bottom: 6px; }
.footer-list{ margin: 0 0 10px 18px; padding: 0; }
.footer-sign{ opacity: .7; }

/* Erişilebilirlik */
:focus-visible{
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}