/* ==========================================================================
   AMORISLY ACCOUNT DELETION PORTAL - DESIGN SYSTEM & ACCESSIBLE STYLING
   ========================================================================== */

:root {
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-focus: rgba(79, 70, 229, 0.25);
  
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-focus: rgba(220, 38, 38, 0.25);
  --color-danger-subtle: #fef2f2;
  --color-danger-border: #fecaca;
  
  --color-success: #16a34a;
  --color-success-subtle: #f0fdf4;
  --color-success-border: #bbf7d0;

  --color-warning: #d97706;
  --color-warning-subtle: #fffbeb;
  --color-warning-border: #fde68a;

  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
}

.portal-wrapper {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

/* Header */
.portal-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.brand-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.header-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

.header-subtitle {
  font-size: 0.925rem;
  color: var(--color-text-muted);
  max-width: 460px;
  margin: 0 auto;
}

/* Portal Card */
.portal-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Stepper */
.stepper {
  margin-bottom: 1.75rem;
}

.stepper-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  padding: 0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  transition: all 0.2s ease;
}

.step-number {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.step-item.active {
  color: var(--color-primary);
}

.step-item.active .step-number {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.step-item.completed {
  color: var(--color-success);
}

.step-item.completed .step-number {
  background-color: var(--color-success);
  color: #ffffff;
  border-color: var(--color-success);
}

.step-divider {
  flex: 1;
  height: 2px;
  background-color: var(--color-border);
  margin: 0 0.75rem;
}

/* Alert Banner */
.alert-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  animation: fadeIn 0.25s ease-out;
}

.alert-banner.alert-error {
  background-color: var(--color-danger-subtle);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger);
}

.alert-banner.alert-warning {
  background-color: var(--color-warning-subtle);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning);
}

.alert-banner.alert-success {
  background-color: var(--color-success-subtle);
  border: 1px solid var(--color-success-border);
  color: var(--color-success);
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.screen-intro {
  margin-bottom: 1.5rem;
}

.screen-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.screen-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

/* Forms */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.phone-input-row {
  display: flex;
  gap: 0.5rem;
}

.country-select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  color: var(--color-text-main);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 145px;
}

.country-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-focus);
}

.form-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--color-text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-focus);
}

.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text-main);
  resize: vertical;
  outline: none;
}

.input-hint {
  font-size: 0.775rem;
  color: var(--color-text-muted);
}

/* Legal Notice & Warning Box */
.legal-notice, .warning-box {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  line-height: 1.45;
}

.legal-notice {
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.notice-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.warning-box {
  background-color: var(--color-danger-subtle);
  border: 1px solid var(--color-danger-border);
  color: #7f1d1d;
}

.warning-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-danger);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* OTP Grid */
.otp-inputs-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.otp-digit {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--color-text-main);
  outline: none;
  transition: all 0.15s ease;
}

.otp-digit:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-focus);
}

.otp-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

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

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e2e8f0;
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link:disabled {
  color: var(--color-text-subtle);
  cursor: not-allowed;
  text-decoration: none;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-actions > .btn {
  flex: 1;
}

.center-actions {
  justify-content: center;
  margin-top: 1.5rem;
}

.center-actions > .btn {
  flex: initial;
  min-width: 200px;
}

/* Screen 3: Details & Confirmation Cards */
.confirmation-badge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.success-icon-badge {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background-color: var(--color-success-subtle);
  border: 2px solid var(--color-success-border);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon-badge svg {
  width: 2.25rem;
  height: 2.25rem;
}

.status-pill {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pending {
  background-color: var(--color-warning-subtle);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.details-card {
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-row:first-child {
  padding-top: 0;
}

.detail-label {
  color: var(--color-text-muted);
}

.detail-value {
  font-weight: 600;
  color: var(--color-text-main);
}

.font-mono {
  font-family: var(--font-mono);
}

.text-danger {
  color: var(--color-danger);
}

.instructions-card, .statutory-card {
  padding: 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.825rem;
  line-height: 1.5;
}

.instructions-card {
  background-color: #f0fdf4;
  border: 1px solid var(--color-success-border);
  color: #14532d;
}

.instructions-heading {
  font-size: 0.925rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  color: #166534;
}

.info-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.instructions-text + .instructions-text {
  margin-top: 0.5rem;
}

.statutory-card {
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.statutory-heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.4rem;
}

.contact-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.contact-list li {
  padding: 0.2rem 0;
}

.link-highlight {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 500;
}

/* Spinner */
.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Footer */
.portal-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
}

.footer-links {
  margin-top: 0.4rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.link-sep {
  margin: 0 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

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

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

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
  .portal-card {
    padding: 1.5rem 1.25rem;
  }
  
  .otp-digit {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  .country-select {
    max-width: 120px;
    font-size: 0.8rem;
  }

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