:root {
  --coral: #e8845c;
  --coral-hover: #d4714a;
  --navy: #1a1a2e;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #faf8f6;
  --white: #ffffff;
  --border: #e8e0d8;
  --green: #22c55e;
  --yellow: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo svg {
  width: 28px;
  height: 28px;
}

.logo img {
  height: 28px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.user-name {
  font-size: 14px;
  color: var(--text-light);
}

.btn-logout {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: var(--bg);
  border-color: var(--coral);
  color: var(--coral);
}

/* Main content */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

.greeting {
  margin-bottom: 8px;
}

.greeting h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.plan-badge strong {
  color: var(--coral);
  font-weight: 600;
}

/* Site cards */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.site-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}

.site-card:hover {
  box-shadow: var(--shadow-md);
}

.site-domain {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
  word-break: break-all;
}

.site-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.site-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.site-status .dot.provisioning { background: var(--yellow); }
.site-status .dot.suspended { background: #ef4444; }

.site-actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-primary {
  background: var(--coral);
  color: white;
}

.btn-primary:hover {
  background: var(--coral-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: none;
  color: var(--text-light);
  padding: 8px;
}

.btn-ghost:hover {
  color: var(--coral);
}

/* Add site card */
.add-site-card {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-light);
}

.add-site-card:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.add-site-card .plus {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 8px;
}

/* Quick links */
.quick-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* No plan state */
.no-plan {
  text-align: center;
  padding: 48px 24px;
}

.no-plan h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--navy);
}

.no-plan p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.plan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}

.plan-card:hover {
  box-shadow: var(--shadow-md);
}

.plan-card.featured {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral), var(--shadow);
}

.plan-card .plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.plan-card .plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 4px;
}

.plan-card .plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
}

.plan-card .plan-billing {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.plan-card .plan-features {
  list-style: none;
  margin-bottom: 20px;
}

.plan-card .plan-features li {
  font-size: 14px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-card .plan-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  background: var(--green);
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3 4.3l-6.8 6.8L3 7.5' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3 4.3l-6.8 6.8L3 7.5' stroke='currentColor' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.plan-card .btn {
  width: 100%;
  justify-content: center;
}

/* Auth pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-card .logo {
  justify-content: center;
  font-size: 22px;
  margin-bottom: 32px;
}

.auth-card h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 24px;
  color: var(--navy);
}

.form-group {
  margin-bottom: 16px;
}

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

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(232, 99, 106, 0.1);
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
  margin-top: 8px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--coral);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.error-msg {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  display: none;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  margin: 24px;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--navy);
}

.modal .form-group { margin-bottom: 20px; }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Welcome toast */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: var(--navy);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  z-index: 300;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 4s forwards;
}

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* Responsive */
@media (max-width: 640px) {
  .header { padding: 0 16px; }
  .main { padding: 20px 16px; }
  .sites-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
}
