/* ==========================================================================
   Design Tokens & CSS Variables (Apple Dark Theme Reference)
   ========================================================================== */
:root {
  color-scheme: dark;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Surfaces & Backgrounds */
  --bg-canvas: #000000;
  --bg-surface: rgba(22, 22, 26, 0.7);
  --bg-surface-input: rgba(10, 10, 14, 0.6);
  --bg-code: rgba(8, 8, 12, 0.8);

  /* Borders & Strokes */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(0, 113, 227, 0.8);

  /* Typography Colors */
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #636366;

  /* Apple Brand Colors */
  --accent-apple-blue: #0071e3;
  --accent-apple-hover: #0077ed;
  --accent-apple-active: #0062c4;
  --accent-glow: rgba(0, 113, 227, 0.25);

  /* Status Colors */
  --status-success: #30d158;
  --status-success-bg: rgba(48, 209, 88, 0.12);
  --status-warning: #ff9f0a;
  --status-error: #ff453a;
  --status-error-bg: rgba(255, 69, 58, 0.1);
  --status-error-border: rgba(255, 69, 58, 0.3);

  /* Shadows & Depth */
  --shadow-card: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-glass), inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* Radii */
  --radius-pill: 9999px;
  --radius-card: 24px;
  --radius-inner: 14px;

  /* Transitions */
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-apple);
  --transition-normal: 0.35s var(--ease-apple);
}

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   Ambient Background Lighting (Apple Keynote Style)
   ========================================================================== */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
}

.glow-top {
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.22) 0%, rgba(88, 86, 214, 0.1) 50%, transparent 80%);
}

.glow-bottom {
  bottom: 5%;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.08) 0%, transparent 70%);
}

/* ==========================================================================
   Site Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
}

.header-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-fast);
}

.brand-logo:hover {
  opacity: 0.85;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-highlight);
  color: #ffffff;
}

/* ==========================================================================
   Main Wrap & Layout
   ========================================================================== */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  flex: 1;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  text-align: center;
  margin-bottom: 2.25rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: #ffffff;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 400;
}

/* ==========================================================================
   Vault Card (Interactive Form)
   ========================================================================== */
.vault-card-wrapper {
  position: relative;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  border-color: var(--border-highlight);
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.input-label svg {
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.vault-input {
  width: 100%;
  height: 50px;
  padding: 0 1rem 0 2.85rem;
  background-color: var(--bg-surface-input);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: all var(--transition-fast);
}

.vault-input::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.vault-input:hover {
  border-color: var(--border-highlight);
  background-color: rgba(14, 14, 18, 0.8);
}

.vault-input:focus {
  border-color: var(--accent-apple-blue);
  background-color: rgba(14, 14, 18, 0.95);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.vault-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent-apple-blue);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 48px;
  background-color: var(--accent-apple-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
  user-select: none;
}

.btn-primary:hover {
  background-color: var(--accent-apple-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45);
}

.btn-primary:active {
  background-color: var(--accent-apple-active);
  transform: scale(0.985);
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.3);
}

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

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary[aria-busy="true"] .btn-arrow,
.btn-primary[aria-busy="true"] .btn-text {
  display: none;
}

.btn-primary[aria-busy="true"] .btn-spinner {
  display: inline-block;
}

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

/* ==========================================================================
   Error Alert State
   ========================================================================== */
.error-container {
  margin-top: 1rem;
}

.error {
  margin: 0;
  display: none;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-inner);
  background-color: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  color: var(--status-error);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  animation: slide-down 0.25s var(--ease-apple) forwards;
}

.error:not(:empty) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.error:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff453a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

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

/* ==========================================================================
   Result Card (Reveal State)
   ========================================================================== */
.result-card {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  border-color: rgba(48, 209, 88, 0.25);
  animation: slide-up 0.35s var(--ease-apple) forwards;
}

.result-card[hidden] {
  display: none !important;
}

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

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.result-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--status-success-bg);
  border: 1px solid rgba(48, 209, 88, 0.3);
  color: var(--status-success);
}

.result-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-copy:active {
  transform: scale(0.96);
}

.btn-copy.copied {
  background: var(--status-success-bg);
  border-color: rgba(48, 209, 88, 0.4);
  color: var(--status-success);
}

.content-box {
  background-color: var(--bg-code);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
  padding: 1.15rem;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.content-box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.content-box::-webkit-scrollbar-track {
  background: transparent;
}

.content-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.925rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  color: #f1f5f9;
}

.meta-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.2rem;
}

.meta-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
}

.meta-indicator.expired {
  background-color: var(--status-warning);
  box-shadow: 0 0 6px var(--status-warning);
}

.muted {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  width: 100%;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.8);
  padding: 1.75rem 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Accessibility & Mobile Optimizations
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent-apple-blue);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .wrap {
    padding: 2.5rem 1rem 3.5rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 1.85rem;
  }
}


