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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --google-blue: #4285f4;
  --naver-green: #03C75A;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 400;
}

/* ===== Main ===== */
.main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== Step Indicator ===== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.step-dot.active .step-num {
  background: var(--primary);
  color: white;
}

.step-dot.done .step-num {
  background: var(--success);
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease;
}

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

.step-dot.done .step-label {
  color: var(--success);
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: background 0.3s ease;
}

.step-line.done {
  background: var(--success);
}

/* ===== Step Sections ===== */
.step-section {
  display: none;
  animation: fadeInUp 0.4s ease;
}

.step-section.active {
  display: block;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1rem;
  color: var(--gray-500);
  margin-bottom: 32px;
}

/* ===== Login Cards ===== */
.login-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.login-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-lg);
}

.login-card.connected {
  border-color: var(--success);
  background: linear-gradient(180deg, var(--success-light) 0%, white 40%);
}

.login-card-icon {
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
}

.login-card.connected .login-card-icon {
  background: var(--success-light);
}

.login-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.login-card-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.login-status {
  margin-bottom: 20px;
  min-height: 28px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.disconnected {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-badge.connected {
  background: var(--success-light);
  color: #16a34a;
}

.status-badge.connected::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn-outline {
  background: white;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-google {
  background: var(--google-blue);
  color: white;
  width: 100%;
  padding: 14px 24px;
}

.btn-google:hover:not(:disabled) {
  background: #3367d6;
  box-shadow: var(--shadow-md);
}

.btn-naver {
  background: var(--naver-green);
  color: white;
  width: 100%;
  padding: 14px 24px;
}

.btn-naver:hover:not(:disabled) {
  background: #02b550;
  box-shadow: var(--shadow-md);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

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

.btn-secondary .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--gray-600);
}

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

.hidden {
  display: none !important;
}

/* ===== Step Actions ===== */
.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.step-actions.center {
  justify-content: center;
}

/* ===== URL Input ===== */
.url-input-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.input-group {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-field {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--gray-800);
  transition: border-color 0.2s ease;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-field::placeholder {
  color: var(--gray-400);
}

.input-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ===== DNS Result ===== */
.dns-result {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  animation: fadeInUp 0.3s ease;
}

.dns-result.error {
  background: var(--error-light);
  border-color: rgba(239, 68, 68, 0.15);
}

.dns-result-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dns-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.dns-provider {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9375rem;
}

.dns-nameservers {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ===== Error Message ===== */
.error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--error-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 16px;
  animation: fadeInUp 0.3s ease;
}

/* ===== Progress Section ===== */
.progress-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.progress-overall {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 100px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-percent {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 40px;
  text-align: right;
}

/* ===== Progress Steps ===== */
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.progress-step.active {
  background: var(--primary-light);
}

.progress-step.done {
  background: var(--success-light);
}

.progress-step.failed {
  background: var(--error-light);
}

.progress-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.progress-step-icon.pending {
  background: var(--gray-200);
  color: var(--gray-400);
}

.progress-step-icon.pending::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
}

.progress-step-icon.running {
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

.progress-step-icon.running::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.progress-step-icon.done {
  background: var(--success);
  color: white;
}

.progress-step-icon.done::after {
  content: '\2713';
  font-weight: 700;
  font-size: 0.8rem;
}

.progress-step-icon.failed {
  background: var(--error);
  color: white;
}

.progress-step-icon.failed::after {
  content: '\2717';
  font-weight: 700;
  font-size: 0.8rem;
}

.progress-step-icon.skipped {
  background: var(--gray-300);
  color: white;
}

.progress-step-icon.skipped::after {
  content: '\2014';
  font-weight: 700;
  font-size: 0.8rem;
}

.progress-step-icon.guide {
  background: var(--warning);
  color: white;
}

.progress-step-icon.guide::after {
  content: '\1F4CB';
  font-weight: 400;
  font-size: 0.75rem;
}

.progress-step.guide {
  background: var(--warning-light);
}

.progress-step-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.progress-step-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
}

.progress-step-msg {
  font-size: 0.8rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Complete Section ===== */
.complete-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.complete-icon {
  margin-bottom: 16px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.complete-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.complete-desc {
  font-size: 1rem;
  color: var(--gray-500);
}

.result-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.result-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.result-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.result-item-label {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.9375rem;
}

.result-item-value {
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-item-value.success {
  color: var(--success);
}

.result-item-value.failed {
  color: var(--error);
}

.result-item-value.skipped {
  color: var(--gray-400);
}

.result-item-value.warning {
  color: var(--warning);
}

.result-item-value.guide {
  color: var(--warning);
}

/* Result item layout for guide links */
.result-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.result-item-guide {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}

.guide-link {
  color: var(--naver-green);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: color 0.2s;
}

.guide-link:hover {
  color: #02a84d;
  text-decoration: underline;
}

/* Naver guide banner */
.naver-guide-banner {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
}

.guide-banner-content {
  text-align: center;
}

.guide-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.guide-banner-desc {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.5;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.8125rem;
}

/* Step guide text in progress */
.step-guide-text {
  color: var(--warning);
  font-size: 0.8125rem;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 380px;
}

.toast.success {
  background: var(--success);
  color: white;
}

.toast.error {
  background: var(--error);
  color: white;
}

.toast.info {
  background: var(--primary);
  color: white;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--gray-400);
  font-size: 0.8rem;
  border-top: 1px solid var(--gray-200);
  background: white;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header {
    padding: 12px 16px;
  }

  .main {
    padding: 24px 16px 48px;
  }

  .login-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .login-card {
    padding: 24px;
  }

  .step-indicator {
    margin-bottom: 28px;
  }

  .step-line {
    width: 30px;
    margin: 0 4px;
  }

  .step-label {
    font-size: 0.625rem;
  }

  .step-num {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .input-row {
    flex-direction: column;
  }

  .url-input-card {
    padding: 24px;
  }

  .progress-card {
    padding: 24px;
  }

  .progress-step {
    padding: 12px;
  }

  .progress-step-title {
    font-size: 0.85rem;
  }

  .result-card {
    padding: 24px;
  }

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

  .step-actions {
    flex-direction: column-reverse;
  }

  .step-actions .btn {
    width: 100%;
  }

  .toast-container {
    left: 16px;
    right: 16px;
  }

  .toast {
    max-width: 100%;
  }
}

/* ===== Pulse Animation ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Meta Tag Display ===== */
.meta-tag-display {
  margin-top: 8px;
}

.meta-tag-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-tag-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}

.meta-tag-code {
  display: block;
  background: var(--gray-800);
  color: #e5e7eb;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-x: auto;
}

.btn-copy {
  align-self: flex-end;
  padding: 4px 12px;
  font-size: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-copy:hover {
  background: var(--primary-dark);
}

/* ===== Naver Login Hint ===== */
.login-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* ===== Guide Box (Naver step guide) ===== */
.step-guide-box {
  margin-top: 10px;
  padding: 14px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.guide-steps {
  margin: 0 0 12px 16px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.guide-steps li {
  margin-bottom: 4px;
}

.guide-copy-values {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.guide-copy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-copy-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}

.guide-copy-value {
  display: inline-block;
  background: var(--gray-800);
  color: #e5e7eb;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.btn-xs {
  padding: 3px 10px;
  font-size: 0.7rem;
}

.guide-open-btn {
  display: inline-flex;
  margin-top: 4px;
  width: auto;
}

