/* ===== CSS Custom Properties / Design Tokens ===== */
:root {
  /* Primary Colors - White & Pink theme */
  --color-primary: #FF6B9D;
  --color-primary-light: #FF8FB7;
  --color-primary-dark: #E5527F;
  --color-primary-gradient: linear-gradient(135deg, #FF6B9D 0%, #FF8FB7 50%, #FFB6C1 100%);
  --color-primary-glow: rgba(255, 107, 157, 0.3);

  /* Accent Colors */
  --color-accent: #FF4081;
  --color-accent-soft: #FFCDD2;

  /* Background */
  --color-bg: #FFF5F8;
  --color-bg-card: rgba(255, 255, 255, 0.85);
  --color-bg-input: rgba(255, 240, 245, 0.6);
  --color-bg-input-focus: rgba(255, 255, 255, 0.95);

  /* Text */
  --color-text: #2D2D3F;
  --color-text-secondary: #6B6B80;
  --color-text-muted: #9E9EB0;
  --color-text-on-primary: #FFFFFF;

  /* Borders */
  --color-border: rgba(255, 107, 157, 0.15);
  --color-border-focus: rgba(255, 107, 157, 0.5);

  /* Status Colors */
  --color-success: #4CAF50;
  --color-success-bg: #E8F5E9;
  --color-error: #EF5350;
  --color-error-bg: #FFEBEE;
  --color-warning: #FF9800;
  --color-warning-bg: #FFF3E0;
  --color-info: #2196F3;
  --color-info-bg: #E3F2FD;
  --color-pending: #9C27B0;
  --color-pending-bg: #F3E5F5;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.06);
  --shadow-md: 0 4px 20px rgba(255, 107, 157, 0.1);
  --shadow-lg: 0 8px 40px rgba(255, 107, 157, 0.15);
  --shadow-card: 0 8px 32px rgba(255, 107, 157, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Typography */
  --font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  position: relative;
  overflow-x: hidden;
}

/* ===== Background Decorations ===== */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.3), transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.3), transparent 70%);
  bottom: -5%;
  left: -5%;
  animation-delay: -7s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 143, 183, 0.2), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 15px) scale(1.02); }
}

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

/* ===== Card ===== */
.card {
  background: var(--color-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl) var(--space-lg);
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Card Header ===== */
.card-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.logo-icon {
  font-size: 48px;
  margin-bottom: var(--space-sm);
  animation: rocketBounce 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes rocketBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.card-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--color-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
}

/* ===== Steps Indicator ===== */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-xl);
  padding: 0 var(--space-sm);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0.4;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 0.7;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.step.active .step-number {
  background: var(--color-primary-gradient);
  color: var(--color-text-on-primary);
  box-shadow: 0 2px 12px var(--color-primary-glow);
}

.step.completed .step-number {
  background: var(--color-success);
  color: white;
}

.step span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.step.active span {
  color: var(--color-primary);
  font-weight: 600;
}

.step-divider {
  width: 24px;
  height: 2px;
  background: var(--color-accent-soft);
  margin: 0 var(--space-xs);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== Form Sections ===== */
.form-section {
  animation: sectionEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-section.hidden {
  display: none;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.section-icon {
  font-size: 1.3rem;
}

.section-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== Form Fields ===== */
.form-field {
  margin-bottom: var(--space-lg);
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.form-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.form-col {
  display: flex;
  flex-direction: column;
}

.form-col.flex-grow {
  flex: 1;
}

/* ===== Input Groups ===== */
.input-group {
  position: relative;
  margin-bottom: var(--space-md);
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-input);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  outline: none;
}

.input-group input::placeholder {
  color: var(--color-text-muted);
  font-weight: 300;
}

.input-group input:focus {
  border-color: var(--color-border-focus);
  background: var(--color-bg-input-focus);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
}

.input-group input:hover:not(:focus) {
  border-color: rgba(255, 107, 157, 0.3);
}

.input-glow {
  display: none;
}

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--color-primary);
}

/* ===== Auth Type Badge ===== */
.auth-type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(255, 182, 193, 0.12));
  border: 1.5px solid rgba(255, 107, 157, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary-dark);
  white-space: nowrap;
  margin-top: var(--space-sm);
}

.badge-icon {
  font-size: 1rem;
}

/* ===== Help Link ===== */
.help-link {
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  margin-left: var(--space-sm);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 157, 0.08);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.help-link:hover {
  background: rgba(255, 107, 157, 0.15);
  color: var(--color-primary-dark);
}

/* ===== Buttons ===== */
.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn-primary {
  background: var(--color-primary-gradient);
  color: var(--color-text-on-primary);
  box-shadow: 0 4px 16px var(--color-primary-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(255, 107, 157, 0.4);
  transform: translateY(-1px);
}

/* Submit Button */
.btn-submit {
  background: linear-gradient(135deg, var(--color-primary) 0%, #FF4081 100%);
  color: var(--color-text-on-primary);
  box-shadow: 0 4px 16px var(--color-primary-glow);
  font-size: 1rem;
  padding: 16px 24px;
}

.btn-submit:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(255, 64, 129, 0.4);
  transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 182, 193, 0.15));
  color: var(--color-primary-dark);
  border: 1.5px solid rgba(255, 107, 157, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(255, 182, 193, 0.2));
  border-color: rgba(255, 107, 157, 0.35);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(255, 107, 157, 0.04);
}

/* Danger Button (Cancel) */
.btn-danger {
  background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
  color: var(--color-text-on-primary);
  box-shadow: 0 4px 16px rgba(239, 83, 80, 0.3);
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(239, 83, 80, 0.45);
  transform: translateY(-1px);
}

/* Disabled state for danger button */
.btn-danger.btn-disabled,
.btn-danger:disabled {
  background: linear-gradient(135deg, #BDBDBD 0%, #9E9E9E 100%);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Button loader */
.btn-loader {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ===== Message Box ===== */
.message-box {
  margin-top: var(--space-md);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  animation: messageSlide 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-box.success {
  background: var(--color-success-bg);
  color: #2E7D32;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.message-box.error {
  background: var(--color-error-bg);
  color: #C62828;
  border: 1px solid rgba(239, 83, 80, 0.2);
}

.message-box.info {
  background: var(--color-info-bg);
  color: #1565C0;
  border: 1px solid rgba(33, 150, 243, 0.2);
}

.message-box.warning {
  background: var(--color-warning-bg);
  color: #E65100;
  border: 1px solid rgba(255, 152, 0, 0.2);
}

/* ===== Status Card ===== */
.status-card {
  background: linear-gradient(135deg, rgba(255, 240, 245, 0.6), rgba(255, 255, 255, 0.8));
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Status variants */
.status-badge.pending {
  background: var(--color-pending-bg);
  color: var(--color-pending);
}
.status-badge.pending .status-dot {
  background: var(--color-pending);
  animation: pulse 1.5s ease infinite;
}

.status-badge.running {
  background: var(--color-info-bg);
  color: var(--color-info);
}
.status-badge.running .status-dot {
  background: var(--color-info);
  animation: pulse 1s ease infinite;
}

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

.status-badge.failed {
  background: var(--color-error-bg);
  color: var(--color-error);
}
.status-badge.failed .status-dot {
  background: var(--color-error);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.status-details {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.status-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 107, 157, 0.06);
}

.status-details .detail-row:last-child {
  border-bottom: none;
}

.status-details .detail-label {
  color: var(--color-text-muted);
  font-weight: 400;
}

.status-details .detail-value {
  color: var(--color-text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.status-actions {
  display: flex;
  gap: var(--space-md);
}

.status-actions .btn {
  flex: 1;
}

/* ===== Footer ===== */
.footer-note {
  text-align: center;
  margin-top: var(--space-lg);
  animation: fadeIn 0.6s ease 0.3s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.footer-note p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.footer-note .text-muted {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ===== Responsive Design ===== */

/* Tablets & Small Desktops */
@media (max-width: 768px) {
  body {
    padding: var(--space-md);
    justify-content: flex-start;
    padding-top: var(--space-xl);
  }

  .container {
    max-width: 100%;
  }

  .card {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-lg);
  }

  .card-header h1 {
    font-size: 1.5rem;
  }

  .logo-icon {
    font-size: 40px;
  }

  .blob-1 { width: 250px; height: 250px; }
  .blob-2 { width: 200px; height: 200px; }
  .blob-3 { width: 180px; height: 180px; }
}

/* Mobile Phones */
@media (max-width: 480px) {
  body {
    padding: var(--space-sm);
    padding-top: var(--space-md);
  }

  .card {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-md);
  }

  .card-header h1 {
    font-size: 1.35rem;
  }

  .subtitle {
    font-size: 0.82rem;
  }

  .steps-indicator {
    gap: 0;
    padding: 0;
  }

  .step span {
    font-size: 0.72rem;
  }

  .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .step-divider {
    width: 16px;
    margin: 0 2px;
  }

  .form-row {
    flex-direction: column;
    gap: var(--space-md);
  }

  .input-group input {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .btn-submit {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .status-actions {
    flex-direction: column;
  }

  .auth-type-badge {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .section-title h2 {
    font-size: 1rem;
  }

  .status-details .detail-row {
    flex-direction: column;
    gap: 2px;
  }

  .status-details .detail-value {
    text-align: left;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .card {
    padding: var(--space-md) var(--space-sm);
  }

  .card-header h1 {
    font-size: 1.2rem;
  }

  .steps-indicator {
    transform: scale(0.9);
    transform-origin: center;
  }
}

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

/* Smooth scrolling for all elements */
* {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: rgba(255, 107, 157, 0.2);
  color: var(--color-text);
}
