/* ─── Auth Gateway Styles ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #16213e;
  --primary-dark: #0f3460;
  --accent: #e94560;
  --accent-hover: #d63851;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #059669;
  --success-bg: #ecfdf5;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16213e 0%, #0f3460 50%, #1a1a2e 100%);
}

.auth-container {
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

/* ─── Cards ─── */
.auth-card, .select-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.select-card {
  max-width: 640px;
}

.auth-container:has(.select-card) {
  max-width: 680px;
}

/* ─── Header ─── */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  margin-bottom: 16px;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-header .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Alerts ─── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

/* ─── Form ─── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: #fafbfc;
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
  background: #fff;
}

.input-wrapper input::placeholder {
  color: #9ca3af;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ─── Footer ─── */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted) !important;
}

.logout-link:hover {
  color: var(--error) !important;
}

.back-link {
  color: var(--text-muted) !important;
}

/* ─── App Grid (Auswahlseite) ─── */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 8px;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  border: 2px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s;
  background: #fafbfc;
}

.app-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(233, 69, 96, 0.15);
  transform: translateY(-4px);
  background: #fff;
}

.app-card .app-icon {
  margin-bottom: 16px;
}

.app-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.app-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.app-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paperclip-card .app-badge {
  background: #fef2f2;
  color: var(--accent);
}

.hermes-card .app-badge {
  background: #eff6ff;
  color: var(--primary);
}

/* ─── Terminal Box ─── */
.terminal-box {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.terminal-header {
  background: #2d2d2d;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  color: #999;
  font-size: 0.8rem;
  margin-left: 8px;
}

.terminal-body {
  background: #1e1e1e;
  padding: 20px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9rem;
}

.terminal-line {
  color: #d4d4d4;
  margin-bottom: 8px;
  line-height: 1.6;
}

.terminal-line .prompt {
  color: #27c93f;
  margin-right: 8px;
}

.terminal-line.comment {
  color: #6a9955;
}

/* ─── Info Section ─── */
.info-section {
  margin-bottom: 16px;
}

.info-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--primary);
}

.info-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.info-card p {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.info-card ol {
  padding-left: 20px;
}

.info-card li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-card code {
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .auth-container { padding: 16px; }
  .auth-card, .select-card { padding: 28px 24px; }
  .app-grid { grid-template-columns: 1fr; }
  .auth-header h1 { font-size: 1.4rem; }
}
