/* CSS Variables - Minimalist Black & White */
:root {
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-color: #d0d0d0;
  --border-hover: #a0a0a0;
  --border-focus: #000000;
  --background: #ffffff;
  --input-bg: #ffffff;
  --error-color: #dc2626;
  --success-color: #16a34a;
  --success-bg: #f0fdf4;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fafafa;
  min-height: 100vh;
  line-height: 1.6;
  color: var(--text-primary);
  padding: 3rem 1.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
}

/* Form Card */
.form-card {
  background: transparent;
  padding: 3rem 2.5rem;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 600px) {
  .form-card {
    padding: 2rem 1.5rem;
  }
}

/* Form Header */
.form-header {
  margin-bottom: 2.5rem;
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.form-logo {
  height: 100px;
  width: auto;
  margin: 0 auto;
  display: block;
  transition: var(--transition);
}

.form-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Form */
form {
  padding: 0;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group .required {
  color: var(--error-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  border: 1.5px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover,
.form-group input[type="tel"]:hover,
.form-group input[type="date"]:hover,
.form-group select:hover {
  border-color: var(--border-hover);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  transition: all 0.3s ease;
}

.form-group select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Date Input Calendar Icon */
.form-group input[type="date"] {
  position: relative;
  cursor: pointer;
  color-scheme: light;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--text-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

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

/* Error State */
.form-group.has-error input {
  border-color: var(--error-color);
  background: #fff5f5;
}

.error-message {
  display: none;
  color: var(--error-color);
  font-size: 0.75rem;
  margin-top: 0.375rem;
}

/* Success State */
.success-message {
  display: none;
  color: var(--success-color);
  font-size: 0.75rem;
  margin-top: 0.375rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auto-filled Input Animation */
.form-group input.auto-filled,
.form-group select.auto-filled {
  animation: highlightFill 0.6s ease;
}

@keyframes highlightFill {
  0%, 100% {
    background: var(--input-bg);
  }
  50% {
    background: var(--success-bg);
  }
}

/* Helper Text */
.helper-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  margin-left: 0.5rem;
}

/* ZIP Code Input Wrapper */
.zip-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.zip-input-wrapper input {
  flex: 1;
  padding-right: 2.5rem;
}

.zip-loader {
  position: absolute;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.spinner-small {
  width: 18px;
  height: 18px;
  animation: rotate 1s linear infinite;
}

.spinner-small .path {
  stroke: var(--text-primary);
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* File Upload */
.file-upload-group {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.file-upload-wrapper {
  position: relative;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-content {
  border: 2px dashed var(--border-color);
  padding: 2.5rem;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--input-bg);
  border-radius: var(--radius-md);
}

.file-upload-wrapper:hover .file-upload-content {
  border-color: var(--border-hover);
  background: #ffffff;
}

.file-upload-content.has-file {
  border-color: var(--text-primary);
  border-style: solid;
  background: #ffffff;
}

.file-upload-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.file-upload-content.has-file .file-upload-icon {
  color: var(--text-primary);
}

.file-upload-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.file-upload-link {
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.file-upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.selected-file {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Form Actions */
.form-actions {
  margin-top: 2.5rem;
  display: flex;
  justify-content: flex-start;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background: #000000;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover:not(:disabled) {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active:not(:disabled) {
  background: #000000;
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spinner */
.spinner {
  animation: rotate 1s linear infinite;
  width: 16px;
  height: 16px;
}

.spinner .path {
  stroke: white;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Form Message */
.form-message {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  text-align: left;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  animation: slideInMessage 0.3s ease;
}

@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-message.success {
  background: #fafafa;
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.form-message.error {
  background: #fff5f5;
  color: var(--error-color);
  border-color: var(--error-color);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  body {
    padding: 2rem 1rem;
  }

  .form-header h1 {
    font-size: 1.25rem;
  }

  .file-upload-content {
    padding: 1.5rem;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
  }
}