/* ═══════════════════════════════════════════════════════════
 *  Authletic Virtual Try-On — Frontend Styles
 * ═══════════════════════════════════════════════════════════ */

/* ── Trigger button ───────────────────────────────────────── */

.atr-tryon-wrap {
   margin: 12px 0;
}

.atr-tryon-btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 5px 12px;
   border: none;
   border-radius: 6px;
   color: #fff;
   font-size: 12px;
   font-weight: 600;
   letter-spacing: 0.02em;
   cursor: pointer;
   transition: opacity 0.2s, transform 0.15s;
}

.atr-tryon-btn:hover {
   opacity: 0.88;
   transform: translateY(-1px);
}

.atr-tryon-btn:active {
   transform: translateY(0);
}

.atr-tryon-btn svg {
   flex-shrink: 0;
}

/* ── Body scroll lock ─────────────────────────────────────── */

body.atr-no-scroll {
   overflow: hidden;
}

/* ── Modal overlay ────────────────────────────────────────── */

.atr-modal {
   display: none;
   position: fixed;
   inset: 0;
   z-index: 999999;
   align-items: center;
   justify-content: center;
}

.atr-modal.atr-open {
   display: flex;
}

.atr-modal-backdrop {
   position: absolute;
   inset: 0;
   background: rgba(0, 0, 0, 0.55);
   backdrop-filter: blur(4px);
   -webkit-backdrop-filter: blur(4px);
}

.atr-modal-panel {
   position: relative;
   width: 92%;
   max-width: 480px;
   max-height: 90vh;
   overflow-y: auto;
   background: #fff;
   border-radius: 4px;
   box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
   padding: 0;
   animation: atr-slide-up 0.25s ease-out;
}

@keyframes atr-slide-up {
   from {
      opacity: 0;
      transform: translateY(24px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/* ── Modal header ─────────────────────────────────────────── */

.atr-modal-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 20px 24px 12px;
}

.atr-modal-header h2 {
   margin: 0;
   font-size: 20px;
   font-weight: 700;
   color: #111;
}

.atr-modal-close {
   background: none;
   border: none;
   font-size: 28px;
   line-height: 1;
   color: #666;
   cursor: pointer;
   padding: 4px 8px;
   border-radius: 6px;
   transition: background 0.15s;
}

.atr-modal-close:hover {
   background: #f0f0f0;
}

/* ── Steps container ──────────────────────────────────────── */

.atr-step {
   padding: 0 24px 24px;
}

/* ── Upload zone ──────────────────────────────────────────── */

.atr-upload-zone {
   position: relative;
   border: 2px dashed #333;
   border-radius: 12px;
   padding: 18px 19px;
   text-align: center;
   cursor: pointer;
   transition: border-color 0.2s, background 0.2s;
   min-height: 185px;
   display: flex;
   align-items: center;
   justify-content: center;
   background: #fafafa;
}

.atr-upload-zone:hover,
.atr-upload-zone.atr-dragover {
   border-color: #000;
   background: #f0f0f0;
}

.atr-file-input {
   position: absolute;
   width: 0;
   height: 0;
   opacity: 0;
   overflow: hidden;
}

.atr-upload-placeholder {
   color: #666;
}

.atr-upload-placeholder svg {
   color: #999;
   margin-bottom: 8px;
}

.atr-upload-placeholder p {
   margin: 4px 0;
   font-size: 14px;
}

.atr-upload-placeholder p strong {
   color: #111;
   font-size: 16px;
}

.atr-upload-hint {
   color: #999 !important;
   font-size: 13px !important;
}

/* ── Upload preview ───────────────────────────────────────── */

.atr-upload-preview {
   display: flex;
   flex-direction: column;
   align-items: center;
}

.atr-upload-preview img {
   max-width: 100%;
   max-height: 300px;
   border-radius: 8px;
   object-fit: contain;
}

.atr-change-photo {
   display: inline-block;
   margin-top: 10px;
   padding: 6px 16px;
   background: #f5f5f5;
   border: 1px solid #ddd;
   border-radius: 6px;
   font-size: 13px;
   color: #333;
   cursor: pointer;
   transition: background 0.15s;
}

.atr-change-photo:hover {
   background: #eee;
}

/* ── Product info ─────────────────────────────────────────── */

.atr-product-info {
   margin: 16px 0;
   padding: 10px 14px;
   background: #f8f8f8;
   border-radius: 8px;
   font-size: 14px;
   color: #444;
}

.atr-product-info p {
   margin: 0;
}

/* ── Generate button ──────────────────────────────────────── */

.atr-generate-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 100%;
   padding: 14px;
   background: #111;
   color: #fff;
   border: none;
   border-radius: 10px;
   font-size: 16px;
   font-weight: 600;
   font-family: inherit;
   cursor: pointer;
   transition: opacity 0.2s;
   min-height: 50px;
}

.atr-generate-btn:hover:not(:disabled) {
   opacity: 0.85;
}

.atr-generate-btn:disabled {
   opacity: 0.4;
   cursor: not-allowed;
}

.atr-btn-loading {
   display: flex;
   align-items: center;
   gap: 10px;
}

/* ── Spinner ──────────────────────────────────────────────── */

.atr-spinner {
   display: inline-block;
   width: 20px;
   height: 20px;
   border: 2.5px solid rgba(255, 255, 255, 0.3);
   border-top-color: #fff;
   border-radius: 50%;
   animation: atr-spin 0.7s linear infinite;
}

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

/* ── Result step ──────────────────────────────────────────── */

.atr-result-image {
   text-align: center;
   margin-bottom: 16px;
}

.atr-result-image img {
   max-width: 100%;
   max-height: 420px;
   border-radius: 10px;
   object-fit: contain;
   box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.atr-result-disclaimer {
   background: #fef9e7;
   border: 1px solid #f0e4b8;
   border-radius: 6px;
   padding: 10px 14px;
   margin-bottom: 12px;
}

.atr-result-disclaimer p {
   margin: 0;
   font-size: 11px;
   line-height: 1.5;
   color: #7a6a2f;
}

.atr-result-actions {
   display: flex;
   gap: 10px;
}

.atr-download-btn {
   flex: 1;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   padding: 12px;
   background: #111;
   color: #fff !important;
   text-decoration: none !important;
   border-radius: 8px;
   font-size: 14px;
   font-weight: 600;
   transition: opacity 0.2s;
}

.atr-download-btn:hover {
   opacity: 0.85;
   color: #fff !important;
}

.atr-tryagain-btn {
   flex: 1;
   padding: 12px;
   background: #f0f0f0;
   color: #333;
   border: 1px solid #ddd;
   border-radius: 8px;
   font-size: 14px;
   font-weight: 600;
   font-family: inherit;
   cursor: pointer;
   transition: background 0.15s;
}

.atr-tryagain-btn:hover {
   background: #e5e5e5;
}

/* ── Error state ──────────────────────────────────────────── */

.atr-error {
   padding: 24px;
   text-align: center;
}

.atr-error-message {
   color: #c62828;
   font-size: 15px;
   margin-bottom: 16px;
}

.atr-error-dismiss {
   padding: 10px 24px;
   background: #111;
   color: #fff;
   border: none;
   border-radius: 8px;
   font-size: 14px;
   font-weight: 600;
   font-family: inherit;
   cursor: pointer;
   transition: opacity 0.2s;
}

.atr-error-dismiss:hover {
   opacity: 0.85;
}

/* ── Modal footer ─────────────────────────────────────────── */

.atr-modal-footer {
   padding: 12px 24px;
   text-align: center;
   border-top: 1px solid #f0f0f0;
}

.atr-modal-footer p {
   margin: 0;
   font-size: 12px;
   color: #aaa;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
   .atr-modal-panel {
      width: 100%;
      max-height: 95vh;
      border-radius: 4px;
      margin: 20px;
   }

   .atr-modal-header {
      padding: 12px 13px 8px;
   }

   .atr-step {
      padding: 0 13px 12px;
   }

   .atr-upload-zone {
      padding: 24px 16px;
      min-height: 160px;
   }

   .atr-result-actions {
      flex-direction: column;
   }
}

/* ── Privacy notice ─────────────────────────────────────── */

.atr-privacy-notice {
   display: flex;
   align-items: flex-start;
   gap: 8px;
   background: #f0f7f0;
   border: 1px solid #c8e6c8;
   border-radius: 8px;
   padding: 6px 13px;
   margin-top: 10px;
   margin-bottom: 0;
   font-size: 9px;
   line-height: 1.3;
   color: #2e5c2e;
}

.atr-privacy-notice svg {
   flex-shrink: 0;
   margin-top: 1px;
   stroke: #4a8c4a;
}

/* ── Upload guidance ───────────────────────────────────── */

.atr-guidance-heading {
   margin: 0 0 8px;
   font-size: 13px;
   font-weight: 700;
   color: #1d2327;
   text-transform: uppercase;
   letter-spacing: 0.04em;
}

.atr-upload-guidance {
   background: #faf9f7;
   border: 1px solid #e8e5e0;
   border-radius: 10px;
   padding: 11px 13px;
   margin-bottom: 16px;
}

.atr-guidance-badge {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   font-size: 13px;
   font-weight: 600;
   color: #555;
   margin-bottom: 6px;
}

.atr-guidance-badge.atr-guidance-butt-lift {
   color: #000;
}

.atr-guidance-badge svg {
   flex-shrink: 0;
}

.atr-guidance-butt-lift svg {
   stroke: #f59e0b;
   fill: #fef3c7;
}

.atr-guidance-text {
   font-size: 12px;
   line-height: 1.3;
   color: #444;
   margin: 0 0 0 0;
}

.atr-guidance-text strong {
   color: #000;
}

@media (max-width: 480px) {
   .atr-upload-guidance {
      padding: 12px 14px;
   }
}

/* ── Confetti animation ────────────────────────────────── */

.atr-confetti-container {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 100%;
   overflow: hidden;
   pointer-events: none;
   z-index: 10;
}

.atr-confetti-piece {
   position: absolute;
   top: -10px;
   width: 8px;
   height: 8px;
   border-radius: 2px;
   opacity: 0;
   animation: atr-confetti-fall linear forwards;
}

@keyframes atr-confetti-fall {
   0% {
      opacity: 1;
      transform: translateY(0) rotate(0deg) scale(1);
   }

   50% {
      opacity: 1;
   }

   100% {
      opacity: 0;
      transform: translateY(400px) rotate(720deg) scale(0.3);
   }
}

.atr-success-toast {
   position: absolute;
   top: 16px;
   left: 50%;
   transform: translateX(-50%) translateY(-20px);
   background: #000;
   color: #fff;
   padding: 10px 20px;
   border-radius: 8px;
   font-size: 14px;
   font-weight: 600;
   white-space: nowrap;
   opacity: 0;
   transition: opacity 0.3s, transform 0.3s;
   z-index: 20;
   pointer-events: none;
}

.atr-success-toast.atr-toast-visible {
   opacity: 1;
   transform: translateX(-50%) translateY(0);
}