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

:root {
  --bg-color: #0d0d12;
  --surface-color: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.1);
  --primary-color: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --accent-color: #f97316;
  --success-color: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --glass-blur: blur(16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(249, 115, 22, 0.1), transparent 25%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.5;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

/* Utils */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.slide-up { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(13, 13, 18, 0.8);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #2dd4bf);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-size: 16px;
  font-weight: 600;
}

.brand-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Buttons */
button {
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  color: inherit;
}

button:active {
  transform: scale(0.97);
}

.btn-pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-color);
}
.btn-orange:hover {
  background: rgba(249, 115, 22, 0.25);
}

.btn-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-color);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  text-align: center;
  margin-top: 10px;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-accent {
  background: var(--accent-color);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn-success {
  background: var(--success-color);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Chat Section */
.chat-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 260px;
}

.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  animation: slideUp 0.3s ease;
}

.message.ai {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message.user {
  background: var(--primary-color);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat Options Bottom */
.options-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  background: linear-gradient(to top, var(--bg-color) 80%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  background: var(--surface-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: all 0.2s;
}

.option-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Configurator & Contract Views */
.view-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg-color);
  z-index: 20;
  padding: 20px;
  padding-bottom: 80px;
  overflow-y: auto;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: var(--glass-blur);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

/* Controls */
.stepper {
  display: flex;
  align-items: center;
  gap: 15px;
}

.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success-color);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  background: #18181b;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 30px 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Specific UI */
.qr-box {
  background: white;
  padding: 15px;
  border-radius: 12px;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}

.qr-box img {
  width: 100%;
  height: 100%;
}

.share-btn {
  position: absolute;
  bottom: -10px;
  right: -10px;
  background: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.code-box {
  background: rgba(59, 130, 246, 0.1);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-main);
  margin-top: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-row.discount {
  color: #ef4444;
  font-weight: 600;
}

.summary-row.urgent {
  color: var(--accent-color);
  font-weight: 600;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--surface-border);
  font-size: 20px;
  font-weight: bold;
}

.total-row span:last-child {
  color: var(--success-color);
}

hr {
  border: 0;
  border-top: 1px solid var(--surface-border);
  margin: 15px 0;
}
