@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --primary: #0F172A;
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --success: #059669;
  --success-bg: #D1FAE5;
  --error: #DC2626;
  --error-bg: #FEE2E2;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
}

/* Card */
.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* Logo Section */
.logo {
  text-align: center;
  margin-bottom: 24px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* SVG ICON FIX - constrain size */
.logo-icon svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  fill: white !important;
  display: block;
}

h1 {
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

/* Button */
button {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Link */
.link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.link:hover {
  color: var(--accent);
}

/* Messages */
.message {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.message.success {
  background: var(--success-bg);
  color: var(--success);
}

.message.error {
  background: var(--error-bg);
  color: var(--error);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

/* UPLOADER PAGE */
.container-wide {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header .logo-icon {
  margin: 0;
  width: 32px;
  height: 32px;
}

.header .logo-icon svg {
  width: 16px !important;
  height: 16px !important;
}

.header h1 {
  margin: 0;
  font-size: 16px;
}

.header .subtitle {
  margin: 0;
  font-size: 12px;
}

.logout-btn {
  width: auto;
  padding: 6px 12px;
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  margin: 0;
}

.logout-btn:hover {
  background: var(--bg);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  background: var(--bg);
  padding: 32px 24px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: var(--accent);
}

.upload-area.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

/* SMALL UPLOAD ICON FIX */
.upload-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  color: var(--text-secondary);
}

.upload-icon svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  display: block;
}

.upload-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-or {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0;
}

.browse-btn {
  width: auto;
  padding: 8px 16px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 13px;
  margin: 8px 0;
}

.browse-btn:hover {
  background: var(--bg);
  border-color: var(--border);
}

.file-name {
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
  margin-top: 8px;
}

.max-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Status */
.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.status.success {
  background: var(--success-bg);
  color: var(--success);
}

.status.error {
  background: var(--error-bg);
  color: var(--error);
}

.status.loading {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 520px) {
  .card { padding: 24px 20px; }
  .container-wide { padding: 20px 16px; }
}
