/* Modern, elder-friendly, accessible CSS styling for AventraFlow */
:root {
  --brand-primary: #1976D2;
  --brand-primary-hover: #1565C0;
  --brand-bluegreen: #00796B;
  --brand-bg: #F8FBFD;
  --card-bg: #FFFFFF;
  --text-main: #1C2733;
  --text-muted: #5F6D7E;
  --border-color: #E2E8F0;
  --success-color: #059669;
  --success-bg: #ECFDF5;
  --error-color: #DC2626;
  --error-bg: #FEF2F2;
  --line-green: #06C755;
  --line-green-hover: #05B34C;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-full: 9999px;
}

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

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--brand-bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Brand Header */
.brand-header {
  text-align: center;
  margin-bottom: 8px;
}

.brand-logo-icon {
  font-size: 38px;
  margin-bottom: 4px;
}

.brand-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-bluegreen);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

/* State Management */
.state-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.3s ease forwards;
}

.state-section.hidden {
  display: none !important;
}

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

/* Badges & Titles */
.card-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: #E0F2FE;
  color: #0369A1;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.35;
}

.card-description {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Code Display Box */
.code-box {
  background: #F1F5F9;
  border: 1.5px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.code-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand-primary);
}

/* User Account Profile Box */
.user-profile-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 8px;
  text-align: left;
}

.user-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #E2E8F0;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  outline: none;
  gap: 10px;
  padding: 0 16px;
}

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

.btn-primary {
  background-color: var(--brand-primary);
  color: #FFFFFF;
}

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

.btn-secondary {
  background-color: #F1F5F9;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #E2E8F0;
}

.btn-google {
  background-color: #FFFFFF;
  color: #3C4043;
  border: 1px solid #DADCE0;
  box-shadow: 0 1px 2px rgba(60,64,67,0.08);
}

.btn-google:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-line {
  background-color: var(--line-green);
  color: #FFFFFF;
}

.btn-line:hover {
  background-color: var(--line-green-hover);
}

.btn-app-link {
  background-color: #0F172A;
  color: #FFFFFF;
}

.btn-app-link:hover {
  background-color: #1E293B;
}

/* Forms */
.auth-action-box {
  width: 100%;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #94A3B8;
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 12px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

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

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.input-group input {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
  background-color: #FFFFFF;
}

.input-group input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.form-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* Success and Error States */
.icon-success {
  width: 64px;
  height: 64px;
  background-color: var(--success-bg);
  color: var(--success-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 16px;
}

.icon-error {
  width: 64px;
  height: 64px;
  background-color: var(--error-bg);
  color: var(--error-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 16px;
}

.error-text {
  font-size: 15px;
  color: var(--error-color);
  line-height: 1.5;
}

.status-text {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 16px;
}

.success-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Loading Spinner */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #E2E8F0;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Footer */
.footer {
  text-align: center;
  font-size: 12px;
  color: #94A3B8;
}
