/* Cestani Web Application Portal - Predominantly Dark Theme */
:root {
  /* Brand Palette from cestani-logo.svg */
  --color-navy: #00244B;
  --color-navy-dark: #020B17;
  --color-navy-surface: #071D38;
  --color-navy-card: #0A264A;
  --color-navy-input: #031021;
  
  --color-gold: #E6A52F;
  --color-gold-hover: #F5B84B;
  --color-gold-glow: rgba(230, 165, 47, 0.25);
  
  --color-teal: #1F8266;
  --color-teal-bright: #26A683;
  --color-purple: #3D1D80;
  
  --color-bg: #020B17;
  --color-surface: #092140;
  --color-surface-subtle: #051529;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-hover: rgba(255, 255, 255, 0.2);
  --color-border-focus: var(--color-gold);
  
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;
  --color-text-subtle: #64748B;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(20, 62, 122, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(61, 29, 128, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(31, 130, 102, 0.2) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Staging Bar */
.dev-staging-bar {
  background-color: #041021;
  border-bottom: 1px solid rgba(230, 165, 47, 0.4);
  color: #F8FAFC;
  padding: 8px 20px;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

.dev-badge {
  background-color: var(--color-gold);
  color: #020B17;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  margin-right: 8px;
  letter-spacing: 0.03em;
}

.dev-link {
  color: var(--color-gold);
  text-decoration: none;
  font-weight: 600;
}

.dev-link:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* App Header */
.app-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.app-logo {
  width: 40px;
  height: 40px;
  display: block;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.app-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #CBD5E1;
  background: rgba(7, 29, 56, 0.8);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--color-teal-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-teal-bright);
}

/* App Main Body */
.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.portal-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 470px;
  padding: 44px 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00244B, #E6A52F, #1F8266, #3D1D80);
}

.portal-header {
  text-align: center;
  margin-bottom: 30px;
}

.portal-headline {
  font-size: 1.75rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.portal-subtext {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* SSO Login Options */
.sso-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: var(--color-navy-card);
  color: #FFFFFF;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 48px;
}

.btn-sso:hover {
  background-color: #10335E;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.sso-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider */
.portal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 26px 0;
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
  font-weight: 500;
}

.portal-divider::before,
.portal-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-divider span {
  padding: 0 14px;
}

/* Direct Token Form */
.token-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.token-input-field {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  background-color: var(--color-navy-input);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.token-input-field::placeholder {
  color: var(--color-text-subtle);
}

.token-input-field:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-glow);
}

.btn-token-submit {
  width: 100%;
  padding: 13px 16px;
  background-color: var(--color-gold);
  color: #020B17;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
}

.btn-token-submit:hover {
  background-color: var(--color-gold-hover);
  box-shadow: 0 4px 14px var(--color-gold-glow);
  transform: translateY(-1px);
}

/* Privacy & Security Note */
.security-note {
  margin-top: 28px;
  padding: 14px 16px;
  background-color: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.security-note svg {
  color: var(--color-teal-bright);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Interactive Feedback Toast */
.toast-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.toast-msg.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.toast-msg.info {
  background-color: rgba(230, 165, 47, 0.15);
  color: #FFE399;
  border: 1px solid rgba(230, 165, 47, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.app-footer {
  padding: 28px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.app-footer a {
  color: #E2E8F0;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

@media (max-width: 480px) {
  .portal-card {
    padding: 32px 20px;
  }
}
