:root {
  --bg: #0f172a;
  --panel: rgba(255,255,255,0.06);
  --panel-border: rgba(255,255,255,0.08);

  --text: #f8fafc;
  --muted: #94a3b8;

  --accent: #6366f1;
  --accent-2: #8b5cf6;

  --radius: 22px;

  --shadow:
    0 10px 30px rgba(0,0,0,0.25);

  --transition: 0.25s ease;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:'Inter',sans-serif;
  background:
    radial-gradient(circle at top left,#1e1b4b,#0f172a 55%);
  color:var(--text);
  min-height:100vh;
}

/* APP LAYOUT */

.app{
  display:grid;
  grid-template-columns:380px 1fr;
  min-height:100vh;
}

/* SIDEBAR */

.sidebar{
  border-right:1px solid var(--panel-border);
  background:rgba(15,23,42,0.85);
  backdrop-filter:blur(20px);

  padding:28px;
  overflow:auto;
}

a.back {
  float:right;
  margin-bottom: 10px;
  color: #ffffff;
  -webkit-text-decoration: none;
  -moz-text-decoration: none;
  text-decoration: none;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:34px;
}

.brand-icon{
  width:52px;
  height:52px;
  border-radius:18px;

  display:grid;
  place-items:center;

  background:linear-gradient(
    135deg,
    var(--accent),
    var(--accent-2)
  );

  font-size:22px;
  font-weight:700;
}

.brand h1{
  font-size:1.2rem;
  font-weight:700;
}

.brand p{
  color:var(--muted);
  font-size:0.9rem;
}

/* PANELS */

.panel{
  background:var(--panel);
  border:1px solid var(--panel-border);

  border-radius:var(--radius);

  padding:20px;
  margin-bottom:22px;
}

.panel h2{
  margin-bottom:18px;
  font-size:0.9rem;
  letter-spacing:1px;
  text-transform:uppercase;
  color:#cbd5e1;
}

/* COMPARTMENTALIZED GRID EDITOR */

.grid-editor{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.grid-editor .full{
  grid-column:1 / -1;
}

/* INPUTS */

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

label{
  font-size:0.85rem;
  color:#cbd5e1;
}

input,
select,
textarea{
  width:100%;

  border:none;
  outline:none;

  border-radius:16px;

  background:#111827;
  color:white;

  padding:14px;

  transition:var(--transition);

  border:1px solid transparent;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--accent);
  box-shadow:
    0 0 0 4px rgba(99,102,241,0.15);
}

input[type="color"]{
  height:52px;
  padding:6px;
  cursor:pointer;
}

/* BUTTON */

.generate-btn{
  width:100%;
  border:none;
  cursor:pointer;

  margin-top:10px;

  padding:16px;

  border-radius:18px;

  color:white;
  font-weight:600;
  font-size:1rem;

  background:linear-gradient(
    135deg,
    var(--accent),
    var(--accent-2)
  );

  transition:var(--transition);
}

.generate-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 15px 30px rgba(99,102,241,0.35);
}

/* WORKSPACE */

.workspace{
  padding:34px;
  overflow:auto;
}

.preview-card{
  background:rgba(255,255,255,0.06);
  border:1px solid var(--panel-border);

  border-radius:32px;

  padding:32px;
  margin-bottom:30px;

  box-shadow:var(--shadow);
}

.preview-header{
  display:flex;
  justify-content:space-between;
  align-items:center;

  margin-bottom:28px;
}

.preview-header span{
  color:var(--muted);
}

.preview-area{
  min-height:280px;

  display:flex;
  justify-content:center;
  align-items:center;

  border-radius:24px;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.04),
      rgba(255,255,255,0.02)
    );
}

.input-preview{
  width:min(480px,100%);
}

.input-preview label{
  display:block;
  margin-bottom:12px;
  font-size:0.95rem;
}

.input-preview input{
  background:white;
  color:#0f172a;
}

/* CODE */

.code-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}

.code-card{
  background:#020617;
  border:1px solid rgba(255,255,255,0.06);

  border-radius:26px;
  overflow:hidden;
}

.code-top{
  display:flex;
  justify-content:space-between;
  align-items:center;

  padding:18px 20px;

  border-bottom:1px solid rgba(255,255,255,0.06);
}

.code-top h3{
  font-size:0.9rem;
}

textarea{
  height:300px;
  resize:none;

  border-radius:0;
  border:none;

  background:transparent;

  font-family:
    "JetBrains Mono",
    monospace;

  line-height:1.6;
}

/* COPY */

.copy-btn{
  border:none;
  cursor:pointer;

  background:#111827;
  color:white;

  padding:10px 14px;

  border-radius:12px;

  transition:var(--transition);
}

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

/* RESPONSIVE */

@media(max-width:1100px){

  .app{
    grid-template-columns:1fr;
  }

  .sidebar{
    border-right:none;
    border-bottom:1px solid var(--panel-border);
  }

  .code-grid{
    grid-template-columns:1fr;
  }

}

@media(max-width:640px){

  .workspace{
    padding:18px;
  }

  .sidebar{
    padding:18px;
  }

  .grid-editor{
    grid-template-columns:1fr;
  }

}