/* CCQ Website Styles */

:root {
  --brand: #004080;
  --brand-dark: #003060;
  --brand-light: #0059b3;
  --bg: #f5f7fa;
  --text: #333;
  --text-muted: #666;
  --ok: #126e2e;
  --err: #a40000;
  --err-light: #fee;
  --disabled: #ccc;
  --border: #d8dbe1;
  --border-focus: #004080;
  --white: #fff;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  --success-bg: #f0fdf4;
  --success-border: #86efac;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--white);
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: 0 2px 10px var(--shadow);
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 10px var(--shadow);
  animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  main {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .hero-section h2 {
    font-size: 1.5rem;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .btn-large {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    width: 100%;
  }
  
  .download-success {
    padding: 2rem 1rem;
  }
  
  .download-success-icon {
    font-size: 3rem;
  }
  
  .download-success h2 {
    font-size: 1.5rem;
  }
  
  .download-info {
    padding: 1rem;
  }
}

h1, h2, h3 {
  color: var(--brand);
  margin-top: 0;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

p {
  margin: 0.7rem 0;
}

ul {
  margin-left: 1.25rem;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-light);
  text-decoration: underline;
}

/* Form Styles */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.grid .full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group.has-error label {
  color: var(--err);
}

.form-group.has-error input,
.form-group.has-error select {
  border-color: var(--err);
  background-color: var(--err-light);
}

.form-group.has-error .error-message {
  display: block;
  color: var(--err);
  font-size: 0.875rem;
  margin-top: 0.375rem;
}

.error-message {
  display: none;
}

.form-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  display: block;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--white);
  transition: all 0.2s ease;
  font-family: inherit;
}

input[type="text"]:hover,
input[type="email"]:hover,
select:hover {
  border-color: var(--brand-light);
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 64, 128, 0.1);
  transform: translateY(-1px);
}

input[type="text"]:valid:not(:placeholder-shown),
input[type="email"]:valid:not(:placeholder-shown) {
  border-color: var(--ok);
}

input[type="text"]:invalid:not(:placeholder-shown):not(:focus),
input[type="email"]:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--err);
  background-color: var(--err-light);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.radio-group {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.2s;
}

.radio-group:hover {
  border-color: var(--brand-light);
}

.radio-group:has(input:focus) {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 64, 128, 0.1);
}

.radio-group label {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.radio-group label:hover {
  background-color: rgba(0, 64, 128, 0.05);
}

.radio-group input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--brand);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--brand);
  color: var(--white);
  padding: 0.875rem 1.5rem;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 64, 128, 0.2);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover:not([disabled])::before {
  width: 300px;
  height: 300px;
}

.btn:hover:not([disabled]) {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 64, 128, 0.3);
}

.btn:active:not([disabled]) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 64, 128, 0.2);
}

.btn[disabled] {
  background: var(--disabled);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading::after {
  content: '';
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-large {
  font-size: 1.125rem;
  padding: 1.125rem 2.25rem;
}

.btn-success {
  background: var(--ok);
}

.btn-success:hover:not([disabled]) {
  background: #0f5f26;
}

/* Message Styles */
.messages {
  margin-bottom: 1.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 0.75rem 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.5;
  border-left: 4px solid;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msg::before {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.msg.error {
  background: #fde7e7;
  color: var(--err);
  border-left-color: var(--err);
}

.msg.error::before {
  content: '!';
  font-weight: bold;
  font-size: 1.2rem;
}

.msg.success {
  background: var(--success-bg);
  color: var(--ok);
  border-left-color: var(--ok);
}

.msg.success::before {
  content: '✓';
  font-weight: bold;
  font-size: 1.1rem;
}

.msg.info {
  background: #e7f0f9;
  color: var(--brand);
  border-left-color: var(--brand);
}

.msg.info::before {
  content: 'i';
  font-style: italic;
  font-weight: bold;
}

/* Section Styles */
.section {
  margin-top: 2rem;
}

.section:first-child {
  margin-top: 0;
}

.text-center {
  text-align: center;
}

.muted {
  color: var(--text-muted);
}

/* Download Success Page */
.download-success {
  text-align: center;
  padding: 3rem 2rem;
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.download-success-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: block;
  animation: bounceIn 0.6s ease-out;
}

.download-success-icon::before {
  content: '✓';
  display: inline-block;
  width: 4rem;
  height: 4rem;
  background: var(--ok);
  color: white;
  border-radius: 50%;
  line-height: 4rem;
  text-align: center;
  font-weight: bold;
  font-size: 2.5rem;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.download-success h2 {
  color: var(--ok);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.download-success p {
  font-size: 1.1rem;
  margin: 1rem 0;
  color: var(--text);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.download-info {
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 500px;
  text-align: left;
}

.download-info h3 {
  margin-top: 0;
  color: var(--ok);
  font-size: 1.125rem;
}

.download-info ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.download-info li {
  margin: 0.5rem 0;
}

/* Footer */
footer {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-small {
  font-size: 0.9rem;
}

.text-large {
  font-size: 1.1rem;
}

.font-bold {
  font-weight: 700;
}

/* Form Progress Indicator */
.form-progress {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.progress-step::before {
  content: '';
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--border);
  display: block;
  margin: 0 auto 0.5rem;
  transition: all 0.3s;
}

.progress-step.active::before {
  background: var(--brand);
  transform: scale(1.1);
}

.progress-step.complete::before {
  background: var(--ok);
  content: '✓';
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

.progress-step-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.progress-step.active .progress-step-label {
  color: var(--brand);
  font-weight: 600;
}

/* Language Selector Enhancement */
.language-select-wrapper {
  position: relative;
}

/* Landing Page Enhancements */
.hero-section {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(0, 64, 128, 0.05) 0%, rgba(0, 48, 96, 0.05) 100%);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  padding: 1.5rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px var(--shadow);
}

.feature-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--brand);
}

.feature-card h4 {
  margin-top: 0;
  font-size: 1.125rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.feature-icon {
  display: none;
}

.feature-card p {
  margin: 0.5rem 0 0 0;
  color: var(--text-muted);
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Loading State */
.form-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

/* Checkbox Group */
.checkbox-group label:hover {
  border-color: var(--brand-light);
  background-color: rgba(0, 64, 128, 0.02);
}

.checkbox-group input[type="checkbox"]:checked ~ div {
  color: var(--brand);
}

/* Graphical Preview */
.graphical-preview {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
}

.graphical-preview h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--brand);
}

.graphical-image-container {
  text-align: center;
}

.graphical-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  margin-bottom: 1rem;
  max-height: 600px;
  object-fit: contain;
}

/* Version Grid */
.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.version-card {
  padding: 1.5rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.3s;
}

.version-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px var(--shadow);
}

.version-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--brand);
}

.graphical-version-card {
  background: linear-gradient(135deg, rgba(0, 64, 128, 0.02) 0%, rgba(0, 48, 96, 0.02) 100%);
}

.graphical-preview-mini {
  margin: 1rem 0;
  text-align: center;
  background: var(--white);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.graphical-preview-mini img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow);
}
