/* Фотохостинг — главная страница */
:root {
  --bg-deep: #0a0c10;
  --bg-card: rgba(18, 22, 32, 0.72);
  --bg-card-solid: #121620;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #5b8cff;
  --accent-2: #a78bfa;
  --glow: rgba(91, 140, 255, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(91, 140, 255, 0.22), transparent),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(167, 139, 250, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(91, 140, 255, 0.08), transparent);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #8fb4ff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 12, 16, 0.75);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo svg {
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #fff;
  box-shadow: 0 4px 24px var(--glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(91, 140, 255, 0.45);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .nav {
    display: none;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.25);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.hero h1 span {
  background: linear-gradient(135deg, #fff 0%, #a8c4ff 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 32ch;
  margin: 0 0 1.75rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Hero visual */
.hero-visual {
  position: relative;
  min-height: 320px;
}

.frame-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame {
  position: absolute;
  width: 78%;
  max-width: 380px;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.frame-1 {
  transform: rotate(-6deg) translateX(-12%);
  z-index: 1;
  background: linear-gradient(145deg, #1a2234, #0f141c);
}

.frame-2 {
  transform: rotate(4deg) translateX(8%);
  z-index: 2;
  background: linear-gradient(145deg, #1e2840, #121a28);
}

.frame-3 {
  transform: rotate(-2deg);
  z-index: 3;
  background: linear-gradient(160deg, #252d42, #151b28);
}

.frame-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.frame-inner svg {
  width: 48%;
  opacity: 0.45;
}

.floating-card {
  position: absolute;
  bottom: 8%;
  right: 4%;
  z-index: 10;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.floating-card svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Features */
.section {
  padding: 4rem 0;
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.feature-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(91, 140, 255, 0.25);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
}

.feature-card:nth-child(2) .feature-icon {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-2);
}

.feature-card:nth-child(3) .feature-icon {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* CTA band */
.cta-band {
  margin: 2rem 0 4rem;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.15), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(91, 140, 255, 0.2);
  text-align: center;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.cta-band p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--text);
}

/* Auth, формы, дашборд */
.auth-page .nav {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-user {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.container-narrow {
  width: min(440px, 92vw);
}

.auth-page {
  padding: 2rem 0 4rem;
}

.form-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-card--spaced {
  margin-bottom: 1.5rem;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.page-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.field input:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

.btn-block {
  width: 100%;
  margin-top: 0.25rem;
}

.form-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.dashboard-page {
  padding: 2.5rem 0 4rem;
}

.dashboard-head {
  margin-bottom: 2rem;
}

.dashboard-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.dashboard-lead {
  color: var(--muted);
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.dashboard-card-icon--2 {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-2);
}

.dashboard-stat {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.dashboard-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.dashboard-card--link {
  padding: 0;
  overflow: hidden;
}

.dashboard-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  color: var(--text);
  transition: background 0.2s ease;
}

.dashboard-card-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.dashboard-link-text {
  font-weight: 600;
}

.dashboard-link-arrow {
  color: var(--accent);
  font-size: 1.25rem;
}

.dashboard-hint {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-hint code {
  font-size: 0.85em;
  color: var(--accent);
}

/* Загрузка и галерея */
.upload-layout .container {
  width: min(900px, 92vw);
}

.upload-head {
  margin-bottom: 1.75rem;
}

.upload-intro {
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 52ch;
}

.upload-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(18, 22, 32, 0.4);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible {
  border-color: rgba(91, 140, 255, 0.45);
  outline: none;
}

.upload-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
}

.upload-dropzone-icon {
  display: block;
  margin: 0 auto 1rem;
  color: var(--accent);
  opacity: 0.85;
}

.upload-dropzone-title {
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.upload-dropzone-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.upload-summary {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.upload-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.upload-summary-row strong {
  color: var(--text);
}

.upload-global-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.upload-global-label {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-global-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.upload-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-progress--global {
  height: 12px;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.12s ease-out;
}

.upload-item.is-uploading .upload-progress-fill {
  transition: width 0.05s linear;
}

.upload-progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  background-size: 200% 100%;
  animation: upload-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.upload-item.is-uploading .upload-progress-shimmer,
.upload-global-wrap.is-uploading .upload-progress-shimmer {
  animation-duration: 0.9s;
}

@keyframes upload-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.upload-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.upload-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-item.is-uploading {
  border-color: rgba(91, 140, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.12);
  animation: upload-row-pulse 1.8s ease-in-out infinite;
}

.upload-item.is-done {
  border-color: rgba(52, 211, 153, 0.25);
}

.upload-item.is-error {
  border-color: rgba(239, 68, 68, 0.35);
}

@keyframes upload-row-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.08);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.1);
  }
}

.upload-item-preview {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  aspect-ratio: 1;
}

.upload-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.upload-item-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.upload-item-status {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.upload-item.is-uploading .upload-item-status {
  color: var(--accent);
}

.upload-item.is-done .upload-item-status {
  color: #6ee7b7;
}

.upload-item.is-error .upload-item-status {
  color: #fca5a5;
}

.upload-error {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  margin-bottom: 1rem;
}

.gallery-layout .container {
  width: min(1100px, 94vw);
}

.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.gallery-empty .btn {
  margin-top: 1rem;
}

.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-card-preview {
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.35);
}

.gallery-card-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-meta {
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.gallery-card-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-share {
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.gallery-share summary {
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

.gallery-share summary::-webkit-details-marker {
  display: none;
}

.gallery-share-body {
  padding: 0 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.share-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
}

.share-input,
.share-textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: 0.82rem/1.4 ui-monospace, monospace;
}

.share-textarea {
  resize: vertical;
  min-height: 3.5rem;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.btn-sm.is-copied {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}

.share-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.share-qr-canvas {
  border-radius: 8px;
}

.share-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  text-align: center;
}
