:root {
  --bg: #0d0f1a;
  --bg-card: #13162a;
  --bg-input: #1a1f35;
  --cyan: #00d4ff;
  --purple: #a855f7;
  --orange: #f97316;
  --text: #ffffff;
  --text-muted: #8892b0;
  --border: #1e2540;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TYPOGRAPHY ─── */
h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* ─── LOGIN ─── */
.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
  text-align: center;
}

.login-card .brand {
  margin-bottom: 2.5rem;
}

.login-card .brand h1 {
  margin-bottom: 0.3rem;
}

.login-card .brand h2 {
  font-size: 0.85rem;
}

.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--cyan);
}

.btn-primary {
  width: 100%;
  background: var(--cyan);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

/* ─── APP LAYOUT ─── */
.app-header {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header .brand h1 {
  font-size: 1.1rem;
}

.app-header .brand h2 {
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.logout-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  gap: 2rem;
}

.app-title {
  text-align: center;
}

.app-title h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

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

/* ─── DROPZONE ─── */
.dropzone {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.04);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.dropzone p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.dropzone .file-name {
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ─── FORMATS ─── */
.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 600px;
}

.format-badge {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ─── CONVERT BUTTON ─── */
.convert-section {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-convert {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-convert:not(:disabled):hover {
  opacity: 0.9;
}

.btn-convert:not(:disabled):active {
  transform: scale(0.98);
}

/* ─── RESULT ─── */
.result-box {
  width: 100%;
  max-width: 600px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.result-box.visible {
  display: flex;
}

.result-box .result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-download {
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-download:hover {
  opacity: 0.85;
}

.error-box {
  width: 100%;
  max-width: 600px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  color: var(--error);
  font-size: 0.9rem;
  display: none;
}

.error-box.visible {
  display: block;
}

/* ─── LOADING ─── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13, 15, 26, 0.4);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── FOOTER ─── */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}
