/* ═══════════════════════════════════════════════════════════════
   Akulichev Calls — Auth Page (Dark Theme)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary:     #0E1621;
  --bg-secondary:   #17212B;
  --bg-tertiary:    #1C2A3A;
  --bg-surface:     #182533;
  --bg-hover:       #1E3246;
  --accent:         #3390EC;
  --accent-hover:   #2B7ED8;
  --accent-light:   rgba(51, 144, 236, 0.15);
  --text-primary:   #F5F5F5;
  --text-secondary: #8B9BAA;
  --text-tertiary:  #6B7C8A;
  --text-accent:    #6AB2F2;
  --border-subtle:  rgba(255,255,255,0.06);
  --border-light:   rgba(255,255,255,0.1);
  --danger:         #E5533B;
  --font-family:    'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-weight: 400;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.d-none, .hidden { display: none !important; }

/* ─── Container ──────────────────────────────────────────── */
#container {
  height: 100%;
}

.auth-wrapper {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

@media (min-width: 768px) {
  .auth-card { padding: 40px; }
}

@media (max-width: 768px) {
  .auth-wrapper {
    padding: 0;
    background: var(--bg-secondary);
  }
  .auth-card {
    box-shadow: none;
    border-radius: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ─── Logo ────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  cursor: pointer;
}

.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

/* ─── Tabs ────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.auth-tab {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 200ms;
  font-family: inherit;
}

.auth-tab:hover { color: var(--text-primary); }

.auth-tab.active {
  color: var(--accent);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ─── Form ────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  height: 44px;
  width: 100%;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}

input::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 200ms, opacity 200ms;
  position: relative;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(229, 83, 59, 0.15);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(229, 83, 59, 0.25);
}

.btn-row {
  display: flex;
  gap: 8px;
}
.btn-row .btn-primary { flex: 3; }
.btn-row .btn-secondary { flex: 1; }

/* Spinner inside buttons */
.btn .spinner {
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Divider ─────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider span {
  margin: 0 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─── Checkbox ────────────────────────────────────────────── */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox a {
  color: var(--text-accent);
  text-decoration: none;
}
.checkbox a:hover { text-decoration: underline; }

input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

input[type="checkbox"]:focus {
  box-shadow: none;
}

/* ─── Telegram Login ──────────────────────────────────────── */
#telegramLogin {
  display: flex;
  justify-content: center;
}

/* ─── PWA banners (dark) ──────────────────────────────────── */
#iosPwaHint {
  position: fixed;
  inset-inline: 0;
  bottom: 12px;
  z-index: 50;
  padding: 0 16px;
  pointer-events: none;
}

.ios-hint-card {
  pointer-events: auto;
  margin: 0 auto;
  max-width: 440px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ios-hint-icon {
  margin-top: 2px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.ios-hint-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.ios-hint-text .title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ios-hint-close {
  margin-left: 4px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
}
.ios-hint-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

#pwaInstallBanner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  max-width: 90%;
  z-index: 50;
  animation: bannerSlideUp 300ms ease-out;
}

@keyframes bannerSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pwa-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pwa-banner-text span:first-child {
  font-size: 13px;
  color: var(--text-secondary);
}
.pwa-banner-text span:last-child {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

#pwaInstallButton {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
#pwaInstallButton:hover { text-decoration: underline; }

#pwaCloseBanner {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 200ms;
}
#pwaCloseBanner:hover { color: var(--text-primary); }

/* ─── Focus visible ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Info section ────────────────────────────────────────── */
.auth-info {
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
  padding-top: 16px;
}
.auth-info h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.auth-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.auth-info ul {
  list-style: disc;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
