:root{
  --bg: #0b0e13;
  --card: #121826;
  --muted: #98a2b3;
  --text: #e6e8ee;
  --brand: #7dd3fc;   /* cian suave */
  --brand-2: #a78bfa; /* violeta */
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --border: #1f2937;
  --ring: #334155;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 500px at 20% -10%, rgba(125,211,252,.15), transparent 60%),
              radial-gradient(900px 400px at 100% 0%, rgba(167,139,250,.12), transparent 50%),
              var(--bg);
  color:var(--text);
}

.site-header{
  position: sticky; top:0; z-index:10;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(11,14,19,.9), rgba(11,14,19,.6));
  border-bottom: 1px solid var(--border);
}
.brand{display:flex; align-items:center; gap:14px; padding:14px 18px; max-width:1100px; margin:0 auto;}
.logo{width:44px; height:44px; border-radius:12px; box-shadow: var(--shadow); object-fit:cover}
.brand-text h1{margin:0; font-size:20px; letter-spacing:.4px}
.brand-text p{margin:0; color:var(--muted); font-size:13px}

.container{
  max-width:1100px; margin:24px auto; padding:0 16px;
  display:grid; gap:20px; grid-template-columns: 1.2fr .8fr;
}
@media (max-width: 960px){ .container{grid-template-columns: 1fr} }

.card{
  background: linear-gradient(180deg, rgba(18,24,38,.9), rgba(18,24,38,.7));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

h2{margin:0 0 10px 0; font-size:18px}
.muted{color:var(--muted)}
.form-hint{color:var(--muted); font-size:12px; margin-top:8px}

form{display:block}
.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 720px){ .grid{grid-template-columns: 1fr} }

.form-row{display:flex; flex-direction:column; gap:6px}
label{font-size:13px}
input{
  width:100%;
  appearance: none;
  background: #0f1421;
  border:1px solid var(--ring);
  color:var(--text);
  padding:12px 12px;
  border-radius:12px;
  outline: none;
  transition: border .15s, box-shadow .15s, transform .02s;
}
input:focus{
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(125,211,252,.12);
}
input:invalid{border-color: #3b4254}
small{color:var(--muted); font-size:12px}

.actions{display:flex; gap:12px; margin-top:14px}
.btn{
  border:1px solid var(--ring); background:#0f1421; color:var(--text);
  padding:10px 14px; border-radius:12px; cursor:pointer;
  transition: transform .02s ease, background .15s, border .15s;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color:#05121a; font-weight:600;
}
.btn.ghost:hover{border-color: var(--brand)}

.spinner{
  display:none; width:16px; height:16px; margin-left:8px;
  border-radius:50%; border:2px solid rgba(0,0,0,.2); border-top-color: rgba(0,0,0,.6);
  animation: spin 0.7s linear infinite;
}
.loading .spinner{display:inline-block}
.loading .btn-label{opacity:.75}

.alert{
  margin-top:12px; padding:10px 12px; border-radius:10px; border:1px solid var(--ring); background:#0f1421;
}
.hidden{display:none !important}

.pill{
  display:inline-block; padding:6px 10px; border-radius:999px;
  font-weight:700; letter-spacing:.3px; margin-bottom:8px; border:1px solid var(--ring);
}
.pill.ok{background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.35)}
.pill.warn{background: rgba(245,158,11,.18); border-color: rgba(245,158,11,.35)}
.pill.bad{background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.35)}

.kv{display:grid; gap:8px}
.kv > div{display:flex; gap:10px}
.kv dt{width:110px; color:var(--muted)}
.kv dd{margin:0}

.site-footer{max-width:1100px; margin:14px auto 36px; padding:0 16px; color:var(--muted); font-size:13px}

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

body {
  background: url('assets/background.jpg') no-repeat center center fixed;
  background-size: cover;
  background-color: #000;
  margin: 0;
  font-family: system-ui, sans-serif;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg, #1c4370, #190c60);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0077ff;
  cursor: pointer;
}

.info {
  font-size: 0.85rem;
  color: #ccc;
  margin-top: 4px;
}

.card#result-card{
  display:flex;
  flex-direction:column;
}

.result-visual{
  width:100%;
  margin-top:12px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.result-visual img{
  display:block;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:100%;
  object-fit:contain;
  border-radius:12px;
  box-shadow: var(--shadow);
}

@media (max-width: 600px){
  .result-visual{ margin-top:10px; }
}

#result-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 1rem;
}

#result-visual img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  border-radius: inherit;
}