:root {
  --color1: #69114B;
  --color2: #A21C75;
  --bg-gradient:
    radial-gradient(circle at top left, #f9a8d4 0, transparent 50%),
    linear-gradient(135deg, var(--color1), var(--color2));
  --card-bg: #ffffff;
  --glass-bg: rgba(15, 23, 42, 0.35);
  --border-soft: rgba(148, 163, 184, 0.4);
  --text-main: #111827;
  --text-muted: #6b7280;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  padding: 24px 16px;
  color: var(--text-main);
}

.shell {
  width: 100%;
  max-width: 980px;
}

/* Hide both screens initially – JS decides what to show */
#auth-screen,
#app-screen {
  display: none;
  width: 100%;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
}

@media (max-width: 800px) {
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.brand-text-main {
  font-weight: 700;
  font-size: 20px;
  color: #f9fafb;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand-text-sub {
  font-size: 11px;
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* AUTH SCREEN */

.auth-hero-title {
  font-size: 30px;
  font-weight: 700;
  color: #f9fafb;
  margin: 0 0 8px;
}

.auth-hero-sub {
  font-size: 14px;
  color: #e5e7eb;
  max-width: 380px;
  line-height: 1.45;
  margin: 0 0 22px;
}

.auth-card {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.65),
    0 0 0 1px rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.auth-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0 0 8px;
}

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 4px;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.6);
  color: #f9fafb;
  font-size: 13px;
}

.auth-btn-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
}

.auth-button {
  width: 200px;
  padding: 9px 12px;
  border-radius: 999px;
  border: none;
  background: #f9fafb;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

.auth-button:hover {
  transform: translateY(-1px);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.auth-hint {
  margin-top: 8px;
  font-size: 11px;
  color: #e5e7eb;
  opacity: 0.9;
}

.auth-hint strong {
  font-weight: 600;
}

.auth-error {
  margin-top: 6px;
  font-size: 11px;
  color: #fecaca;
}

/* APP SCREEN */

.app-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 24px 18px;
  box-shadow:
    0 22px 50px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(15, 23, 42, 0.06);
}

.two-column-app {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 800px) {
  .two-column-app {
    grid-template-columns: minmax(0, 1fr);
  }
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 16px;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color1);
  margin-bottom: 2px;
}

.app-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.user-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.user-email-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 999px;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.btn-logout {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: #e5e7eb;
}

.sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
}

.field-app {
  margin-bottom: 16px;
}

.field-app label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color1);
  margin-bottom: 5px;
  display: block;
}

.primary-button {
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--color1), var(--color2));
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.08s ease, box-shadow 0.14s ease;
  box-shadow: 0 12px 30px rgba(88, 28, 135, 0.4);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(88, 28, 135, 0.5);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.side-panel {
  padding: 18px 18px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(248, 250, 252, 0.3);
  background: rgba(15, 23, 42, 0.32);
  color: #e5e7eb;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.4);
  font-size: 12px;
}

.side-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.side-text {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.side-list li {
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.side-list span.bullet {
  font-size: 14px;
  margin-top: 1px;
}

input:focus {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  max-width: 320px;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.hiding {
  animation: toast-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* SPINNER */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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