/* ========================================
   Startpanel — botti.app
   ======================================== */

:root {
  --color-primary: #3A5B82;
  --color-primary-dark: #2E4A6A;
  --color-background: #F7F7F7;
  --color-accent: #95AFC0;
  --color-text: #1A1A1A;
  --color-text-muted: #5A5A5A;
  --color-white: #FFFFFF;
  --color-border: #E2E2E2;
  --color-error: #C0392B;
  --color-error-bg: #FDEDEC;
  --color-success: #27AE60;
  --color-success-bg: #EAFAF1;
  --color-inactive: #95A5A6;
  --color-inactive-bg: #F0F0F0;

  --font-main: 'Open Sans', system-ui, -apple-system, sans-serif;
  --font-tabular: 'Open Sans', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lift: 0 8px 28px rgba(58, 91, 130, 0.15);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Focus ---- */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Login
   ======================================== */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  box-shadow: var(--shadow-md);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.login-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 24px;
  border-left: 3px solid var(--color-error);
}

.login-error.hidden {
  display: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-input {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
  min-height: 48px;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(58, 91, 130, 0.15);
}

.form-input::placeholder {
  color: var(--color-accent);
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

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

.btn-primary:active {
  transform: scale(0.98);
}

/* ========================================
   Portal — Header
   ======================================== */

.portal-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.header-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.header-link:hover {
  color: var(--color-primary);
  background: var(--color-background);
}

/* ========================================
   Portal — Main Layout
   ======================================== */

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

.portal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 768px) {
  .portal-layout {
    grid-template-columns: 340px 1fr;
    gap: 64px;
    align-items: start;
  }

  .portal-hero {
    position: sticky;
    top: 80px;
  }
}

/* ========================================
   Portal — Hero
   ======================================== */

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

/* ========================================
   Portal — App List
   ======================================== */

.app-category {
  margin-bottom: 32px;
}

.app-category:last-child {
  margin-bottom: 0;
}

.category-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-normal),
              box-shadow var(--transition-normal),
              border-color var(--transition-normal);
  min-height: 44px;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-accent);
}

.app-card:active {
  transform: translateY(0);
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

.app-icon svg {
  width: 22px;
  height: 22px;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.app-description {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.status-inactive {
  background: var(--color-inactive-bg);
  color: var(--color-inactive);
}

.app-link-icon {
  color: var(--color-accent);
  width: 18px;
  height: 18px;
}

/* ========================================
   Portal — Footer
   ======================================== */

.portal-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}

.footer-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-link {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-primary);
}

/* ========================================
   Animations
   ======================================== */

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeSlideIn 0.4s ease forwards;
}

[data-animate]:nth-child(2) { animation-delay: 0.08s; }
[data-animate]:nth-child(3) { animation-delay: 0.16s; }
[data-animate]:nth-child(4) { animation-delay: 0.24s; }
[data-animate]:nth-child(5) { animation-delay: 0.32s; }

@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
