/* ─── HouseRight App Portal ──────────────────────────────────────────────── */

:root {
  --primary: #1c2030;
  --primary-light: #2a2f42;
  --accent: #e53d1b;
  --teal: #1b88a5;
  --green: #70b77e;
  --gray-50: #f7f8fa;
  --gray-100: #edf2f4;
  --gray-200: #e2e6ea;
  --gray-300: #cbd1d8;
  --gray-400: #a0a8b4;
  --gray-500: #6b7685;
  --gray-600: #4a5262;
  --gray-700: #2d3348;
  --gray-800: #1c2030;
  --danger: #e53d1b;
  --danger-bg: #fef2ef;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(28,32,48,0.1), 0 1px 2px rgba(28,32,48,0.06);
  --shadow-md: 0 4px 6px rgba(28,32,48,0.08), 0 2px 4px rgba(28,32,48,0.06);
  --shadow-lg: 0 10px 15px rgba(28,32,48,0.1), 0 4px 6px rgba(28,32,48,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--gray-800); background: var(--gray-50); }

/* ─── LOGIN PAGE ──────────────────────────────────────────────────────────── */

.login-body {
  background: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo { margin-bottom: 32px; }

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.login-brand-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.login-brand-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  text-align: left;
  line-height: 1.1;
}

.login-brand-label {
  font-size: 13px;
  color: var(--gray-500);
  text-align: left;
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
}

.sso-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.sso-button:hover { background: var(--primary-light); }

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ─── PORTAL NAV ──────────────────────────────────────────────────────────── */

.portal-nav {
  background: var(--primary);
  padding: 0 24px;
  height: 56px;
}

.portal-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.portal-brand-name {
  color: white;
  font-size: 16px;
  font-weight: 700;
}

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

.portal-user {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.portal-signout {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  text-decoration: none;
}

.portal-signout:hover { color: rgba(255,255,255,0.8); }

/* ─── DASHBOARD ───────────────────────────────────────────────────────────── */

.portal-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.portal-header {
  margin-bottom: 32px;
}

.portal-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.portal-header p {
  font-size: 15px;
  color: var(--gray-500);
}

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

.app-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.app-card:not(.app-card-placeholder):hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.app-card-link {
  display: block;
  padding: 28px 24px 20px;
  text-decoration: none;
  color: inherit;
}

.app-card-icon {
  width: 52px;
  height: 52px;
  background: var(--app-color, var(--teal));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.app-card-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.app-card-info p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

.app-card-url {
  margin-top: 12px;
  font-size: 12px;
  color: var(--teal);
  font-family: "SF Mono", "Fira Code", monospace;
}

.app-card-actions {
  padding: 12px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
}

.app-qr-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
  text-decoration: none;
  padding: 4px 0;
}

.app-qr-btn:hover { color: var(--primary); }

.app-card-placeholder {
  border: 2px dashed var(--gray-200);
  background: transparent;
  box-shadow: none;
}

.app-card-placeholder .app-card-link { cursor: default; }

/* ─── QR CODE PAGE ────────────────────────────────────────────────────────── */

.qr-main {
  display: flex;
  justify-content: center;
  padding: 40px 24px;
}

.qr-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.qr-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

.qr-card h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.qr-description {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.qr-image {
  padding: 20px;
  background: white;
  border-radius: var(--radius-lg);
  display: inline-block;
  margin-bottom: 16px;
}

.qr-image img {
  width: 240px;
  height: 240px;
}

.qr-url {
  font-size: 15px;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 8px;
}

.qr-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 28px;
}

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

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .app-grid { grid-template-columns: 1fr; }
  .login-card { margin: 20px; padding: 32px 24px; }
  .qr-card { padding: 32px 24px; }
  .portal-header h1 { font-size: 22px; }
}
