@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

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

:root {
  --bg: #0a2540;
  --bg-secondary: #0f2d4a;
  --card: #ffffff;
  --text: #0a2540;
  --text-light: #ffffff;
  --text-muted: #425466;
  --text-faded: #8898aa;
  --primary: #635bff;
  --primary-hover: #5851ea;
  --primary-light: rgba(99, 91, 255, 0.1);
  --border: #e3e8ee;
  --success: #0cbc87;
  --warning: #f5b731;
  --danger: #ed5f74;
  --cyan: #80e9ff;
  --green: #0cbc87;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 15px 35px rgba(10,37,64,0.08), 0 5px 15px rgba(0,0,0,0.04);
}

html {
  direction: ltr;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -30%, rgba(99, 91, 255, 0.3), transparent),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(128, 233, 255, 0.15), transparent),
    radial-gradient(ellipse 40% 30% at 15% 20%, rgba(12, 188, 135, 0.1), transparent);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Login page centering */
.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  border: none;
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Login card */
.login-card {
  width: 100%;
  max-width: 400px;
  text-align: left;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 15px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--text);
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
  color: var(--text-faded);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99, 91, 255, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

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

.btn-outline:hover {
  background: #f7f8fa;
  color: var(--text);
  border-color: #cfd7df;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
  width: auto;
}

/* Messages */
.message {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.message-success {
  background: rgba(12, 188, 135, 0.08);
  color: var(--success);
  border: 1px solid rgba(12, 188, 135, 0.2);
}

.message-error {
  background: rgba(237, 95, 116, 0.08);
  color: var(--danger);
  border: 1px solid rgba(237, 95, 116, 0.2);
}

/* Dashboard header */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dash-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
}

.user-info {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 28px;
}

.btn-outline.dash-logout {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline.dash-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* IPTV detail rows */
.detail-row {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faded);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-value {
  font-size: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  word-break: break-all;
  text-align: left;
  color: var(--text);
}

.detail-actions {
  margin-top: 4px;
}

.copy-btn {
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.15s;
  margin-top: 8px;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
  background: rgba(12, 188, 135, 0.08);
}

/* Expiry badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(12, 188, 135, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 183, 49, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(237, 95, 116, 0.1);
  color: var(--danger);
}

/* Spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  .card {
    padding: 24px;
  }

  .detail-row {
    flex-wrap: wrap;
  }

  .detail-value {
    text-align: left;
    width: 100%;
  }

  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
