/* =========================================
   PrintFlow — Shop Registration
   ========================================= */

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

:root {
  --bg:             #0B1120;
  --card-bg:        rgba(255, 255, 255, 0.04);
  --card-border:    rgba(255, 255, 255, 0.08);
  --card-shadow:    0 24px 64px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
  --accent:         #3B82F6;
  --accent-hover:   #60A5FA;
  --accent-glow:    rgba(59, 130, 246, 0.35);
  --accent-soft:    rgba(59, 130, 246, 0.12);
  --text-primary:   #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border:         rgba(255, 255, 255, 0.08);
  --input-bg:       rgba(255, 255, 255, 0.04);
  --input-focus-bg: rgba(59, 130, 246, 0.06);
  --input-border:   rgba(255, 255, 255, 0.10);
  --input-focus:    rgba(59, 130, 246, 0.6);
  --error:          #F87171;
  --error-bg:       rgba(248, 113, 113, 0.10);
  --error-border:   rgba(248, 113, 113, 0.25);
  --success:        #34D399;
  --success-bg:     rgba(52, 211, 153, 0.10);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --font-display:   'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, sans-serif;
}

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

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Background Decoration --- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -30vh;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Page Layout --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 0;
  animation: page-fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Logo Bar --- */
.logo-bar {
  margin-bottom: 36px;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover { opacity: 0.8; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 10px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* --- Card --- */
.card-wrapper {
  width: 100%;
  max-width: 460px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 0 40px rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
}

/* --- Card Header --- */
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 100px;
  padding: 4px 10px;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* --- Form --- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

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

.field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.field-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 12px 14px 12px 42px;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-appearance: none;
}

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

.field-input:focus {
  border-color: var(--input-focus);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.field-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent-hover);
}

/* Invalid state */
.field.invalid .field-input {
  border-color: var(--error);
  background: var(--error-bg);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.12);
}

.field.invalid .input-icon {
  color: var(--error);
}

.field-error {
  font-size: 0.8125rem;
  color: var(--error);
  min-height: 18px;
  display: block;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.field.invalid .field-error {
  opacity: 1;
  transform: translateY(0);
}

/* --- Error Toast --- */
.error-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.error-toast[hidden] { display: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.error-toast-icon {
  color: var(--error);
  flex-shrink: 0;
  margin-top: 1px;
}

.error-toast-text {
  font-size: 0.875rem;
  color: var(--error);
  line-height: 1.5;
}

/* --- Primary Button --- */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #4F46E5 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 13px 24px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

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

.btn-primary:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

/* Spinner */
.btn-spinner svg {
  animation: spin 0.8s linear infinite;
}

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

/* Arrow */
.btn-arrow {
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

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

/* --- Form Footnote --- */
.form-footnote {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 18px;
}

.link {
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 500;
}

.link:hover { text-decoration: underline; }

/* --- Success Card --- */
.success-card {
  text-align: center;
  padding: 48px 36px;
  animation: success-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.success-card[hidden] { display: none; }

@keyframes success-in {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.success-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 28px;
}

.success-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0.3;
  animation: pulse-ring 1.8s ease-out 0.3s infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.3; }
  70%  { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.success-check {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #059669, #34D399);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(52,211,153,0.35);
  animation: check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes check-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.success-details {
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 28px;
  display: grid;
  gap: 10px;
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.success-detail-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.success-detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* --- Footer --- */
.page-footer {
  margin-top: 36px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 520px) {
  .card,
  .success-card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .card-title { font-size: 1.375rem; }

  .logo-bar { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
