/* ═══════════════════════════════════════════
   try.css — "Try Now" page styles
   ═══════════════════════════════════════════ */

/* ── Layout ── */
.try-main {
  padding: 100px 0 60px;
  min-height: calc(100vh - 60px);
}

/* ── Step Indicator ── */
.try-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
}

.try-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.try-step.is-active {
  opacity: 1;
}
.try-step.is-done {
  opacity: 0.7;
}

.try-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease;
}
.try-step.is-active .try-step-num {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 16px rgba(19, 105, 213, 0.3);
}
.try-step.is-done .try-step-num {
  background: var(--accent);
  color: #fff;
}

.try-step-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.try-step.is-active .try-step-label {
  color: var(--text);
}

.try-step-line {
  width: 60px;
  height: 2px;
  background: var(--line);
  margin: 0 16px;
  border-radius: 2px;
  transition: background 0.3s ease;
}
.try-step-line.is-done {
  background: var(--accent);
}

/* ── Panels ── */
.try-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow-soft);
  max-width: 900px;
  margin: 0 auto;
  animation: panelIn 0.4s ease;
}
.try-panel.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

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

.try-panel h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  text-align: center;
}
.try-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 32px;
}

.try-selected-template {
  margin: -14px 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.try-selected-template strong {
  color: var(--text);
}

.try-error {
  max-width: 560px;
  margin: -8px auto 18px;
  padding: 10px 14px;
  border: 1px solid rgba(190, 52, 52, 0.28);
  border-radius: 10px;
  background: rgba(190, 52, 52, 0.08);
  color: #9f2424;
  font-size: 0.9rem;
  text-align: center;
}

.try-error.is-hidden {
  display: none;
}

.try-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 640px);
  margin: -8px auto 24px;
}

.try-options.is-single {
  grid-template-columns: minmax(0, 360px);
  justify-content: center;
}

.try-option-field {
  display: grid;
  gap: 7px;
}

.try-option-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.try-option-field select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.try-option-field select:focus {
  outline: 2px solid rgba(19, 105, 213, 0.18);
  border-color: rgba(19, 105, 213, 0.45);
}

/* ── Template Grid ── */
.try-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.try-tpl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
}
.try-tpl-card:hover {
  border-color: rgba(19, 105, 213, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(19, 105, 213, 0.08);
}
.try-tpl-card.is-selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.06), rgba(22, 160, 133, 0.06));
  box-shadow: 0 4px 18px rgba(19, 105, 213, 0.15);
}

.try-tpl-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.try-tpl-name {
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

/* ── Dropzone ── */
.try-dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 24px;
}
.try-dropzone.is-dragover {
  border-color: var(--primary);
  background: rgba(19, 105, 213, 0.04);
}

.try-upload-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.try-upload-slot {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 150px;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.try-upload-slot.is-dragover {
  border-color: var(--primary);
  background: rgba(19, 105, 213, 0.04);
}

.try-upload-slot.has-file {
  border-style: solid;
}

.try-upload-slot-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.try-upload-slot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(19, 105, 213, 0.08);
  color: var(--primary);
}

.try-upload-slot-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.try-upload-slot-body {
  min-width: 0;
}

.try-upload-slot-label {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
}

.try-upload-slot-meta {
  min-height: 1.35em;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.try-upload-slot-btn {
  cursor: pointer;
  font-size: 0.85rem;
}

.try-upload-icon {
  color: var(--primary);
  margin-bottom: 16px;
  opacity: 0.6;
}
.try-drop-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}
.try-drop-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 20px;
}
.try-browse-btn {
  display: inline-flex;
  cursor: pointer;
}

/* ── Preview ── */
.try-preview {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  margin-bottom: 24px;
}
.try-preview.is-hidden {
  display: none;
}

.try-preview-img-wrap {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.try-preview-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.try-preview-info {
  flex: 1;
  min-width: 0;
}
.try-preview-info p {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
}
.try-preview-info p:first-child {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.try-change-btn {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* ── Actions ── */
.try-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.try-next-btn {
  display: block;
  margin: 0 auto;
  min-width: 200px;
}
.try-next-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Processing ── */
.try-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 0;
}

.try-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.try-spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinRing 1.2s linear infinite;
}
@keyframes spinRing {
  to { transform: rotate(360deg); }
}
.try-spinner-icon {
  color: var(--primary);
  opacity: 0.7;
}

.try-progress {
  width: 100%;
  max-width: 380px;
  height: 6px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.try-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.3s ease;
}
.try-progress-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.try-processing-status {
  min-height: 1.4em;
  margin: -18px 0 0;
  color: var(--primary-deep);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

/* ── Result Compare ── */
.try-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 32px 0;
}
.try-compare-col {
  flex: 1;
  max-width: 340px;
  text-align: center;
}
.try-compare-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}
.try-compare-img {
  padding: 0;
  cursor: zoom-in;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.try-compare-img:focus-visible {
  outline: 3px solid rgba(19, 105, 213, 0.24);
  outline-offset: 3px;
}

.try-compare-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.try-compare-img--result {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(22, 160, 133, 0.15);
}
.try-compare-arrow {
  color: var(--muted);
  opacity: 0.4;
  flex-shrink: 0;
}

.try-download-btn {
  min-width: 200px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(8, 18, 34, 0.82);
}

.image-modal img {
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.2) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.2) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.2) 75%),
    #f8fafc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.image-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.image-modal-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .try-panel {
    padding: 28px 20px;
  }
  .try-tpl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .try-compare {
    flex-direction: column;
  }
  .try-compare-arrow {
    transform: rotate(90deg);
  }
  .try-compare-col {
    max-width: 100%;
  }
  .try-steps {
    gap: 0;
  }
  .try-step-label {
    display: none;
  }
  .try-step-line {
    width: 32px;
    margin: 0 8px;
  }
  .try-preview {
    flex-direction: column;
    text-align: center;
  }
  .try-options {
    grid-template-columns: 1fr;
  }
  .try-upload-slots {
    grid-template-columns: 1fr;
  }
  .try-upload-slot {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .try-upload-slot-img {
    width: 96px;
    height: 96px;
  }
}
