:root {
  --bg: #070b14;
  --surface: #0f172a;
  --surface-2: #111c33;
  --border: #283548;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #0f1c36 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.blocked-card {
  max-width: 480px;
  margin: 18vh auto 0;
  text-align: center;
  color: #f87171;
}

.blocked-card h1 {
  margin: 0;
  font-size: 1.4rem;
}

.login-card {
  max-width: 430px;
  margin: 12vh auto 0;
}

.brand-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

label {
  display: block;
  margin: 20px 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
}

input[type="password"],
.search-input {
  width: 100%;
  background: #0b1120;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="password"]:focus,
.search-input:focus {
  border-color: var(--accent);
}

button,
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  color: #04121d;
}

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

.btn-secondary {
  background: #1e293b;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 0.9rem;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.alert.warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

.portal-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input {
  width: 240px;
  padding: 9px 12px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 24px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text);
}

.app-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-info {
  min-width: 0;
}

.file-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  font-size: 0.76rem;
  color: var(--muted);
}

.download-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: 0.82rem;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.download-btn:hover {
  background: rgba(16, 185, 129, 0.28);
}

.ext-badge {
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 640px) {
  .search-input {
    width: 100%;
  }
}
