/* ============================================
   JetLinkVPN — Dark Glassmorphism Design System
   ============================================ */

/* --- Base & Background --- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #0f172a;
  color: #cbd5e1;
  margin: 0;
  padding: 20px;
  text-align: center;
  min-height: 100vh;
}

/* Gradient mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(59, 130, 246, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: #f1f5f9;
  font-weight: 600;
}

h2 { margin-bottom: 20px; }
h3 { margin-bottom: 12px; }

p, li { line-height: 1.6; }

small { color: #94a3b8; }
strong { color: #e2e8f0; }
code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #a5f3fc;
  font-size: 0.9em;
}
hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 16px 0; }
label { font-weight: 600; color: #e2e8f0; }

/* --- Links --- */
a {
  color: #34d399;
  text-decoration: underline;
  text-decoration-color: rgba(52,211,153,0.3);
  transition: color 0.2s, text-decoration-color 0.2s;
  background: none;
  padding: 0;
  font: inherit;
  border: none;
}
a:hover {
  color: #6ee7b7;
  text-decoration-color: rgba(110,231,183,0.5);
}

a.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: #059669;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
a.btn:hover {
  background-color: #047857;
  box-shadow: 0 4px 15px rgba(5,150,105,0.3);
}

.inline-link {
  color: #34d399;
  text-decoration: underline;
  font-size: 0.95rem;
  background: none;
  padding: 0;
  margin-top: 4px;
  display: inline-block;
}

/* --- Glass Card System --- */
.glass {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.glass-elevated {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Legacy .card support — now renders as glass */
.card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 650px;
  margin: 20px auto;
  padding: 24px;
  text-align: left;
  width: 95%;
}

/* --- Form Styling --- */
form.form-box {
  max-width: 400px;
  margin: 0 auto;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  padding: 30px;
  text-align: left;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  margin: 8px 0 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #f1f5f9;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

select option {
  background: #1e293b;
  color: #f1f5f9;
}

input[type="submit"] {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
input[type="submit"]:hover {
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
  transform: translateY(-1px);
}

.setup-container .card,
.setup-container .form-box {
  padding-top: 1px;
  max-width: 400px;
  width: 100%;
}

/* --- Info Grid --- */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.info-grid > div {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}
.info-grid > div strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 500;
}
.info-grid .full-width {
  grid-column: span 2;
}
.days-row {
  display: flex;
  justify-content: space-between;
  font-weight: normal;
  background: rgba(255,255,255,0.05);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* --- Buttons --- */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-top: 20px;
}
.button-group form { display: contents; }

.btn {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover {
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
  transform: translateY(-1px);
}

.btn.reset {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 12px;
}
.btn.reset:hover {
  box-shadow: 0 4px 15px rgba(220,38,38,0.3);
}

.btn.secondary {
  width: 100%;
  font-size: 15px;
  padding: 13px;
  font-weight: 600;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
}
.btn.secondary:hover {
  background: rgba(255,255,255,0.15);
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn.full-width {
  width: 100%;
  font-weight: 600;
  padding: 13px;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  display: block;
  text-align: center;
}

/* Support buttons */
.email-btn {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 13px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.email-btn:hover { background: rgba(255,255,255,0.15); }

.whatsapp-btn {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  padding: 13px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.whatsapp-btn:hover {
  box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

.btn.support-btn {
  width: 100%;
  padding: 13px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  margin-top: 12px;
}
.btn.support-btn:hover {
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

.btn.download-btn {
  width: 100%;
  padding: 13px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  margin-top: 1px;
  border-radius: 12px;
}
.btn.download-btn:hover {
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

.btn.copy-btn {
  width: 100%;
  padding: 13px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #059669, #10b981);
  margin-top: 1px;
  border-radius: 12px;
}
.btn.copy-btn:hover {
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}

/* --- Warning Card --- */
.card.warning {
  border-left: 4px solid #f87171;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-left: 4px solid #ef4444;
  padding: 16px;
  margin-top: 20px;
  text-align: center;
  border-radius: 16px;
}

/* --- User List --- */
.user-list { list-style: none; padding: 0; }
.user-list li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #cbd5e1;
}
tr:hover { background: rgba(255,255,255,0.03); }
tr:nth-child(even) { background: rgba(255,255,255,0.015); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-brand { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-danger { background: rgba(239,68,68,0.2); color: #f87171; }
.badge-warning { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-info { background: rgba(59,130,246,0.2); color: #60a5fa; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
  50% { box-shadow: 0 0 30px rgba(16,185,129,0.4); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body { padding: 12px; }
  .card {
    width: 95%;
    padding: 1rem;
    margin: 1rem auto;
  }
  .info-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem;
  }
  .info-grid > div {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  .btn { font-size: 0.9rem; padding: 10px; }
  .button-group { gap: 10px; }
  .card h3 { font-size: 1.1rem; text-align: center; }
  .user-list li { font-size: 0.95rem; }
}

/* --- iOS Normalization --- */
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="submit"],
textarea,
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px;
  border-radius: 12px;
}

input,
select,
textarea {
  font-size: 16px;
}

/* Full width buttons on iOS */
input[type="submit"],
.btn,
a.btn {
  font-size: 1rem;
  padding: 12px 24px;
}

/* Tighter spacing for add-device form */
.add-user-form input[type="text"] { margin-bottom: 0px; }
.add-user-form input[type="submit"] { margin-top: 12px; }

/* --- Pre/Code blocks --- */
pre {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px;
  color: #a5f3fc;
  font-size: 0.85rem;
  overflow-x: auto;
}
