/* House Planner SaaS - Auth & Dashboard Styles */
/* Dark theme matching the editor: #1a1a2e bg, #e94560 accent, #16213e panels */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

a { color: #e94560; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth Page Layout ─────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: #16213e;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h1 {
  font-size: 28px;
  color: #fff;
  font-weight: 700;
}

.auth-logo h1 span {
  color: #e94560;
}

.auth-logo p {
  color: #888;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Tabs ─────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid #0f3460;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  color: #888;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.auth-tab.active {
  color: #e94560;
  border-bottom-color: #e94560;
}

.auth-tab:hover {
  color: #e94560;
}

/* ── Forms ────────────────────────────────────────────── */
.auth-form { display: none; }
.auth-form.active { display: block; }

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: #0f3460;
  border: 1px solid #1a4a7a;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #e94560;
}

.form-group input::placeholder {
  color: #555;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #e94560;
  color: #fff;
  width: 100%;
}

.btn-secondary {
  background: #0f3460;
  color: #e0e0e0;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: #666;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 12px;
  margin-top: 8px;
  color: #888;
}

.forgot-link:hover { color: #e94560; }

/* ── Alert / Message ──────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.alert.show { display: block; }
.alert-error { background: #3d1a1a; color: #ff6b6b; border: 1px solid #5c2020; }
.alert-success { background: #1a3d2a; color: #6bffa0; border: 1px solid #205c30; }

/* ── Dashboard Layout ─────────────────────────────────── */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #0f3460;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  font-size: 22px;
  color: #fff;
}

.dashboard-header h1 span { color: #e94560; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu .user-name {
  color: #aaa;
  font-size: 14px;
}

/* ── Trial Banner ─────────────────────────────────────── */
.trial-banner {
  background: linear-gradient(135deg, #0f3460, #16213e);
  border: 1px solid #1a4a7a;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trial-banner.warning {
  border-color: #e94560;
  background: linear-gradient(135deg, #2d1020, #16213e);
}

.trial-banner p {
  font-size: 14px;
}

.trial-banner .days {
  color: #e94560;
  font-weight: 700;
}

/* ── Project Grid ─────────────────────────────────────── */
.projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.projects-toolbar h2 {
  font-size: 18px;
  color: #ccc;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  background: #16213e;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #0f3460;
  transition: border-color 0.2s, transform 0.1s;
  cursor: pointer;
}

.project-card:hover {
  border-color: #e94560;
  transform: translateY(-2px);
}

.project-thumb {
  width: 100%;
  height: 160px;
  background: #0f3460;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb .placeholder {
  font-size: 48px;
  opacity: 0.3;
}

.project-info {
  padding: 14px;
}

.project-info h3 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-info .meta {
  font-size: 12px;
  color: #666;
}

.project-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

/* ── Empty State ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #555;
}

.empty-state .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 18px;
  color: #888;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

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

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

.modal-box {
  background: #16213e;
  border-radius: 12px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.modal-box h2 {
  color: #e94560;
  margin-bottom: 12px;
}

.modal-box p {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── Loading ──────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #0f3460;
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  .auth-card { padding: 24px; }
  .dashboard { padding: 12px; }
  .project-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; gap: 12px; }
}
