/* =========================================
   ROOT VARIABLES
========================================= */
:root {
    --bg: #dbdbdb;
    --card: rgba(0, 0, 0, 0);
    --text: #000000;
    --muted: #171717;
    --stroke: #171717;
    --primary: #ff8a00;
    --primary-2: #ffb347;
    --focus: #7dd3fc;
    --radius: 22px;

}

/* =========================================
   BASE + GLOBAL
========================================= */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  height: 100vh;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 1200px at 90% -10%, rgba(219, 219, 219, 1), transparent 60%),
              radial-gradient(1100px 900px at -20% 120%, rgba(219, 219, 219, 1), transparent 60%),
              var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  justify-content: center;
  overflow: hidden;
}

.shell {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 4px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.shell::-webkit-scrollbar { display: none; }

/* =========================================
   HERO
========================================= */
.logo-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: slideDown .6s ease both;
  width: 100%;
  flex: 0 0 auto;
}
.logo-panel__logo {
  width: clamp(80px, 15vw, 180px);
  height: auto;
  object-fit: contain;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.brand h1 {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand h1 span { display: block; }
.brand .subtitle { color: #1f1f1f; font-size: clamp(14px, 1.8vw, 18px); font-weight: 500; }

/* =========================================
   CARD
========================================= */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)), var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  animation: floatIn .7s ease both;
  margin-bottom: 8px;
}
.card h2 { margin: .2rem 0 1rem; font-size: clamp(18px, 2.6vw, 22px); font-weight: 700; }

/* =========================================
   FORM
========================================= */
form {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.field {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); }

/* Inputs */
.input, .filebox {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border .2s, box-shadow .2s, transform .15s;
}
.input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.12);
}

/* File upload */
.filebox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.filebox .labelText { color: var(--muted); }
.filebox .btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--stroke);
}

/* Previews */
.preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.preview .thumb {
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: #fff;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-primary, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, border .2s, background .2s;
}
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-link {
  background: #fff;
  border-color: var(--stroke);
  color: var(--text);
}
.btn-link:hover { border-color: var(--primary-2); }

/* Messages */
.success, .error {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}
.success {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(240,176,1,0.35);
  color: #3cff00;
}
.error {
  background: rgba(239,68,68,0.774);
  border: 1px solid rgba(97,0,0,0.856);
  color: #ffe1e1;
}

/* Footer */
.page-footer {
  margin-top: auto;
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: clamp(10px, 2vw, 13px);
  width: 100%;
  border-top: 1px solid rgba(0,0,0,0.05);
  flex: 0 0 auto;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.modal-content {
  position: relative;
  background-color: var(--card);
  margin: 15% auto;
  padding: 30px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  text-align: center;
  border: 1px solid var(--stroke);
}
.bounce-logo {
  width: 80px; height: 80px;
  border-radius: 12px;
  margin-bottom: 20px;
  animation: pulse 2s ease infinite;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,138,0,0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 20px rgba(255,138,0,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,138,0,0); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.progress-container { margin-top: 20px; display: none; }
.progress-bar {
  width: 100%; height: 6px;
  background: rgba(50,100,187,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .3s ease;
  border-radius: 3px;
}
.progress-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* =========================================
   RESPONSIVE BREAKPOINTS
========================================= */

/* ===== Small Devices: up to 640px ===== */
@media (max-width: 640px) {
  .page { 
    padding: 12px; 
    gap: 12px;
    height: 100vh;
    overflow: hidden;
  }
  
  .logo-panel { 
    margin-bottom: 0;
    gap: 8px;
  }
  .logo-panel__logo { width: clamp(70px, 12vw, 100px); }
  .brand h1 { font-size: clamp(20px, 6vw, 26px); }
  .brand .subtitle { font-size: clamp(12px, 3.5vw, 15px); }

  .shell { 
    width: 100%; 
    flex: 1;
    min-height: 0;
    padding: 4px 8px 16px;
  }
  .card { 
    padding: 16px; 
    border-radius: 16px; 
  }
  .card h2 { font-size: 16px; margin-bottom: 12px; }

  form { grid-template-columns: 1fr; gap: 10px; }
  .field, .field.full { grid-column: 1 / -1; gap: 6px; }
  .field label { font-size: 12px; }

  .input, .filebox {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    min-height: 40px;
  }
  .filebox { 
    justify-content: space-between; 
    gap: 8px; 
    padding: 6px 6px 6px 12px;
  }
  .filebox .labelText {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }
  .filebox .btn { 
    flex: 0 0 auto; 
    padding: 6px 10px; 
    border-radius: 8px;
    font-size: 12px;
  }

  .preview { grid-template-columns: 1fr; gap: 8px; }
  .preview .thumb { aspect-ratio: 3/2; font-size: 11px; }

  .row { flex-direction: column; gap: 8px; }
  .btn-primary, .btn-link {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
  }
  .page-footer { font-size: 10px; padding: 12px; }
}

/* ===== Medium Devices: 641px-1023px ===== */
@media (min-width: 641px) and (max-width: 1023px) {
  .page { 
    max-width: 600px;
    padding: 20px;
    height: 100vh;
  }
  
  .logo-panel {
    margin-bottom: 16px;
    flex: 0 0 auto;
  }
  .logo-panel__logo { width: clamp(100px, 12vw, 140px); }
  .brand h1 { font-size: clamp(24px, 2.8vw, 30px); }
  .brand .subtitle { font-size: clamp(14px, 1.8vw, 17px); }
  
  .shell { 
    flex: 1;
    min-height: 0;
    max-width: 100%;
    padding: 6px 10px 26px;
  }
  .card { padding: 20px; border-radius: 18px; }
  form { grid-template-columns: 1fr 1fr; gap: 14px; }
  .field { grid-column: span 2; }
  .field.full { grid-column: 1 / -1; }
  .preview { grid-template-columns: 1fr 1fr; }
  .btn-primary, .btn-link { padding: 11px 16px; font-size: 14px; }
}

/* ===== Desktop (Side-by-Side): 1024px and up ===== */
@media (min-width: 1024px) {
  .page {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    grid-template-rows: 1fr;
    gap: 32px;
    max-width: 1400px;
    align-items: flex-start;
    padding: 18px 28px;
    height: 100vh;
    overflow: hidden;
  }

  .logo-panel {
    align-items: flex-start;
    text-align: left;
    margin-bottom: 0;
    align-self: flex-start;
  }

  .logo-panel__logo {
    width: clamp(100px, 12vw, 160px);
  }

  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: clamp(26px, 3.2vw, 40px);
  }

  .brand .subtitle {
    font-size: clamp(14px, 1.3vw, 18px);
    margin-top: 6px;
  }

  .shell {
    max-width: 100%;
    height: 100%;
    padding: 0 8px 8px 2px;
    overflow-y: auto;
  }

  .card {
    padding: 20px;
    border-radius: 18px;
    margin-top: 0;
    margin-bottom: 0;
  }
  
  .card h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  form {
    gap: 12px;
    grid-template-columns: repeat(6, 1fr);
  }
  
  .field {
    gap: 6px;
    grid-column: span 2;
  }
  
  .field label {
    font-size: 12px;
  }
  
  .input, .filebox {
    padding: 9px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
  
  .btn-primary, .btn-link {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .preview .thumb {
    height: clamp(150px, 22vh, 190px);
    aspect-ratio: auto;
    font-size: 11px;
  }
}

/* ===== Large Desktop: 1600px and up ===== */
@media (min-width: 1600px) {
  .page {
    gap: 60px;
    padding: 40px 60px;
  }

  .logo-panel__logo {
    width: clamp(140px, 15vw, 220px);
  }

  .brand h1 {
    font-size: clamp(32px, 4vw, 56px);
  }

  .brand .subtitle {
    font-size: clamp(16px, 1.5vw, 22px);
    margin-top: 8px;
  }

  .card {
    padding: 32px;
    border-radius: 24px;
  }
  
  .card h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }
  
  form {
    gap: 20px;
  }
  
  .field {
    gap: 10px;
  }
  
  .field label {
    font-size: 13px;
  }
  
  .input, .filebox {
    padding: 14px 18px;
    font-size: 15px;
  }
  
  .btn-primary, .btn-link {
    padding: 12px 20px;
    font-size: 15px;
  }
}

/* ===== Very small (<380px) ===== */
@media (max-width: 380px) {
  .page { padding: 8px; gap: 8px; }
  .logo-panel { gap: 6px; }
  .logo-panel__logo { width: 60px; }
  .brand h1 { font-size: 18px; }
  .brand .subtitle { font-size: 11px; }
  .card { padding: 12px; }
  .field { gap: 4px; }
  .field label { font-size: 11px; }
  .input, .filebox { font-size: 13px; padding: 8px 10px; }
  .btn-primary, .btn-link { font-size: 13px; padding: 10px 12px; }
}

/* iOS zoom fix */
@supports (-webkit-touch-callout: none) {
  input, select, textarea, button { font-size: 16px; }
}
