/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --brand-base: #2c7fff;
  --brand-subtle: #dbeafe;
  --brand-strong: #134fa8;

  --secondary: #19b5fe;

  --accent: #ff6b6b;

  --green-call: #7ed553;
  --green-call-hover: #73c04d;

  --text-primary: #2d3748;
  --text-secondary: #525763;
  --text-light: #4d5661;
  --text-error: #dc2626;
  --text-warning: #663c00;
  --text-on-primary: #ffffff;

  --bg-base: #f7f7f7;
  --bg-overlay: #f2f2f2;
  --bg-elevated: #ffffff;
  --bg-green: #cee8ce;
  --bg-success: #d8f9c7;
  --bg-warning: #fff3e0;
  --bg-error: #fddbdb;
  --bg-gradient-primary: linear-gradient(
    135deg,
    var(--brand-base) 0%,
    var(--secondary) 100%
  );

  --yellow-star: #ffdf00;

  --border-overlay: #e2e3e4;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 8px;
  --border-radius-full: 100px;

  --box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);

  --transition: all 0.3s ease;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #dc2626;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Top accent line */
.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

/* Background decorative elements */
.container::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(
    circle,
    rgba(91, 69, 224, 0.08) 0%,
    rgba(91, 69, 224, 0) 70%
  );
  border-radius: 50%;
  z-index: 0;
}

select {
  /* To style the select button element */
  appearance: none; /* This removes the default arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' 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 1rem center; /* Adjust this value to move the arrow */
  background-size: 1em;
}

.select-sm {
  padding: 1rem;
  font-size: 0.9rem;
  border-radius: 10px;
}

.submit-button {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--brand-base) 0%,
    var(--brand-strong) 100%
  );
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(91, 69, 224, 0.3);
  position: relative;
  overflow: hidden;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 69, 224, 0.4);
    background: linear-gradient(
      135deg,
      var(--brand-subtle) 0%,
      var(--brand-base) 100%
    );
  }

  &:active {
    transform: translateY(0);
  }

  &::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      to bottom right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
  }

  &:hover::after {
    animation: shine 1.5s ease-out;
  }
}

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--brand-base);
  border: 1px solid var(--brand-base);

  &:hover {
    background-color: var(--brand-strong);
    color: var(--text-on-primary);
  }
}

.btn-md {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
}

.btn-sm {
  padding: 0.5rem;
  font-size: 0.9rem;
  border-radius: 10px;
}

@keyframes shine {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  80% {
    transform: scale(3) rotate(45deg);
    opacity: 0.5;
  }
  100% {
    transform: scale(4) rotate(45deg);
    opacity: 0;
  }
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

.form-error {
  font-size: 1rem;
  color: var(--text-error);
  margin-bottom: 0.75rem;
}

/* Final urgency message */
.urgency {
  background-color: rgba(255, 107, 107, 0.08);
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 1rem;
  color: var(--text-primary);
  position: relative;
  max-width: 650px;
  margin: 0 auto;
}

.container {
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 2.5rem 1.5rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  .value-props {
    gap: 1.5rem;
  }

  .cta-section {
    padding: 2rem 1.5rem;
  }

  .cta-section h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 2rem 1.25rem;
    border-radius: 12px;
  }

  h1 {
    font-size: 2rem;
  }

  .hero-message {
    padding: 1.25rem 1rem;
  }

  .hero-message p {
    font-size: 1rem;
  }

  .value-prop {
    padding: 1.25rem 1rem;
  }

  .cta-section {
    padding: 1.75rem 1.25rem;
  }

  .submit-button {
    width: 100%;
  }
}

.history-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
}

.history-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  background: var(--color-bg-overlay);
  border: 1px solid transparent;
  transition: var(--transition);

  &:hover,
  &:focus {
    box-shadow: var(--box-shadow);
    background: var(--color-bg-elevated);
    border-color: var(--color-border);
  }
}

.history-item-left {
  display: grid;
  grid-template-areas:
    "left a"
    "left b";
  column-gap: 1rem;
  align-items: center;

  span {
    color: var(--color-text-subtle);
    font-size: 0.8rem;
  }

  /* tablet */
  @media (min-width: 600px) {
    span {
      font-size: 0.9rem;
    }
  }
}

.history-item-left-icon {
  grid-area: left;
  border-radius: 50%;
  size: 3rem;

  .icon {
    color: var(--color-primary);
    size: 1.5rem;
  }
}

.history-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;

  span {
    display: flex;
    gap: 0.5rem;
    align-items: center;

    &.success {
      color: var(--color-positive);
    }

    svg {
      height: 1rem;
      width: 1rem;
      &.icon {
        color: var(--color-text-subtle);
      }
    }

    &.cost {
      font-weight: 600;
    }
  }
}
