/* =========================================================
   Unified iOS Installation Guide - Reference Dark Style
   ========================================================= */

:root {
  --bg-main: #070b14;
  --bg-card: #0e1526;
  --bg-card-inner: #131c31;
  --bg-card-hover: #16223b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.4);
  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
  --accent-blue-light: #60a5fa;
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.08);
  --accent-amber-border: rgba(245, 158, 11, 0.3);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 50% 0%, #111d38 0%, #070b14 65%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* =========================================================
   Pill Badges & Headings
   ========================================================= */

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue-light);
  width: fit-content;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-top: 10px;
  line-height: 1.25;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* =========================================================
   Cards Container
   ========================================================= */

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* =========================================================
   Header & Timer Widget
   ========================================================= */

.header-card {
  position: relative;
  overflow: hidden;
}

.timer-box {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 20px;
}

.timer-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.timer-value {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.04em;
  margin: 4px 0;
}

.timer-subtext {
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================
   Warning Box (iCloud не трогаем)
   ========================================================= */

.warning-card {
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 14px;
}

.warning-card p {
  color: #fbbf24;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

/* =========================================================
   Steps Grid (2 columns on desktop, 1 on mobile)
   ========================================================= */

.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 600px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  border-color: var(--border-focus);
}

.step-media-wrapper {
  background: #040710;
  width: 100%;
  max-height: 440px;
  min-height: 220px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
}

.step-media-wrapper img {
  max-width: 100%;
  max-height: 410px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.step-meta {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #0c1322;
  border-top: 1px solid var(--border-subtle);
  flex-grow: 1;
}

.step-badge-num {
  width: 26px;
  height: 26px;
  background: var(--accent-blue-dark);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.step-text-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* =========================================================
   Credentials Block (Логин / Пароль)
   ========================================================= */

.credentials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 540px) {
  .credentials-grid {
    grid-template-columns: 1fr;
  }
}

.credential-box {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.cred-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.cred-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-all;
}

.btn-cred-copy {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-cred-copy:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue-light);
}

.btn-cred-copy.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

/* =========================================================
   2FA Code Waiting Widget
   ========================================================= */

.code-waiting-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
}

.steps-flow-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

@media (max-width: 520px) {
  .steps-flow-bar {
    grid-template-columns: 1fr;
  }
}

.flow-step-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.flow-step-item .flow-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue-light);
  display: block;
}

.flow-step-item .flow-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.btn-request-code {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-request-code:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-request-code:active {
  transform: translateY(0);
}

.code-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #090e1a;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 14px;
}

.code-digits {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #38bdf8;
}

.code-warning-note {
  font-size: 12px;
  color: #fbbf24;
  margin-top: 10px;
  line-height: 1.4;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 8px;
}

/* =========================================================
   App Install Cards
   ========================================================= */

.app-installer-card {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.app-installer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.app-info-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon-display {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: #1e293b;
}

.app-info-left h4 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.app-info-left p {
  font-size: 13px;
  color: var(--text-dim);
}

.app-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-install-ota {
  padding: 10px 18px;
  background: #3b82f6;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-install-ota:hover {
  background: #2563eb;
}

.btn-install-reserve {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-install-reserve:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-install-copy {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  transition: all 0.2s;
}

.btn-install-copy:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue-light);
}

/* =========================================================
   Final Button
   ========================================================= */

.btn-finish-all {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 14px;
}

.btn-finish-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.6);
}

/* =========================================================
   Toast Notification
   ========================================================= */

.toast-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.success-icon-circle {
  width: 64px;
  height: 64px;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid #22c55e;
  color: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

/* =========================================================
   Expired / Locked Link Screen
   ========================================================= */

.expired-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 40px 16px;
}

.expired-card {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(239, 68, 68, 0.15);
  animation: fadeIn 0.4s ease;
}

.expired-icon-badge {
  width: 72px;
  height: 72px;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.expired-icon-badge svg {
  width: 36px;
  height: 36px;
}

.expired-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.expired-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.expired-info-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
}

.expired-info-box b {
  display: block;
  font-size: 14px;
  color: #f87171;
  margin-bottom: 6px;
}

.expired-info-box span {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  display: block;
}

.expired-help-note {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
