/* =========================
MÓVIL (max-width: 768px)
========================= */
@media (width <= 767px) {
  html {
    font-size: clamp(13px, 3.5vw, 16px);
  }

  /* HOME */
  .home {
    padding: clamp(0.5rem, 2vw, 1rem) 1rem clamp(2rem, 5vw, 3rem);
  }

  .home-inner {
    padding: clamp(1rem, 3vw, 2rem);
  }

  .home-content {
    padding-top: clamp(3rem, 8vh, 5rem);
    gap: clamp(2rem, 6vw, 3rem);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "arrow";
  }

  /* HEADER MÓVIL */
  .home-header {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 1rem;
    margin-bottom: clamp(2rem, 5vw, 3rem);
  }

  .authory-icona-sense-ombra {
    justify-self: start;
    transform: none;
    width: clamp(60px, 12vw, 80px);
    order: 1;
  }

  .lang-selector {
    display: none;
  }

  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    justify-self: end;
    order: 3;
    width: 44px;
    height: 44px;
    gap: 7px;
  }

  .burger span {
    height: 2px;
  }

  .contact {
    display: none;
  }

  /* MENÚ BURGER */
  .menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 160px;
    max-width: 200px;
    padding: 0.8rem;
    font-size: 0.85rem;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 1000;
  }

  .menu.is-open {
    display: flex;
  }

  .menu a {
    font-size: 0.85rem;
    padding: 0.3rem 0;
  }

  .menu-lang {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgb(35 79 194 / 25%);
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .menu-lang .lang-selector {
    display: block;
    position: static;
    width: 100%;
  }

  .menu-lang .lang-toggle {
    background-color: #fbf2e3;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: none;
    font-family: Lexend, sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s;
    color: #234fc2;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 36px;
  }

  .menu-lang .lang-toggle:hover {
    background-color: #e8dac8;
  }

  .menu-lang .lang-dropdown {
    position: static;
    margin-top: 0;
    transform: none;
    box-shadow: none;
    background-color: transparent;
    min-width: auto;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .menu-lang .lang-dropdown.show {
    opacity: 100%;
    visibility: visible;
    max-height: 200px;
    margin-top: 0.5rem;
  }

  .menu-lang .lang-option {
    background-color: #234fc2;
    color: #fbf2e3;
    margin-bottom: 0.3rem;
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    text-align: center;
    font-size: 0.8rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 32px;
  }

  .menu-lang .lang-option:last-child {
    margin-bottom: 0;
  }

  .menu-lang .lang-option:hover {
    background-color: #1a3a8f;
  }

  .menu-lang .lang-option:first-child,
  .menu-lang .lang-option:last-child {
    border-radius: 999px;
  }

  /* HERO */
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.2;
  }

  .home-left {
    max-width: 100%;
    grid-area: left;
    position: relative;
  }

  .hero-right {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100%;
    gap: clamp(1.5rem, 4vw, 2rem);
    grid-area: right;
  }

  .authory-logo-vertical {
    width: clamp(180px, 50vw, 300px);
  }

  .button {
    position: relative;
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .button a {
    line-height: 1;
    display: inline-block;
  }

  .button::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(80px, 30vmin, 120px);
    height: clamp(80px, 30vmin, 120px);
    margin-top: clamp(0.2rem, 2vw, 0.8rem);
    background: url("/images/home-arrow.svg") no-repeat center / contain;
    pointer-events: none;
    animation: arrow-float 1.6s ease-in-out infinite;
  }

  @keyframes arrow-float {
    0%,
    100% {
      transform: translate(-50%, 0);
    }

    50% {
      transform: translate(-50%, 8px);
    }
  }

  .home-arrow {
    display: none;
  }

  .home-exclamation-left {
    width: clamp(0.7em, 0.2vw, 0.9em);
    right: -0.8em;
    top: 0.5em;
  }

  /* HOW */
  .how {
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
    min-height: auto;
  }

  .how-content {
    font-size: clamp(1.05rem, 4vw, 1.6rem);
    gap: clamp(2.5rem, 6vw, 3.5rem);
    width: 100%;
    max-width: none;
  }

  .how-text-1,
  .how-text-2,
  .how-text-3 {
    max-width: 100%;
    text-align: left;
    margin: 0;
    text-wrap: balance;
  }

  .how-text-1,
  .how-text-2,
  .how-text-3,
  .how-text-4 {
    font-size: clamp(1.2rem, 4.8vw, 1.9rem);
  }

  .how-text-1 {
    max-width: 21ch;
  }

  .how-text-2 {
    text-align: right;
    align-self: flex-end;
    max-width: 22ch;
    margin-top: clamp(1rem, 4vw, 2rem);
  }

  .how-text-3 {
    text-align: right;
    align-self: flex-end;
    max-width: 28ch;
    margin-top: clamp(-4rem, -6vw, -5rem);
  }

  .how-exclamation-left {
    left: -1.5em;
    width: 1.2em;
    top: 0.8em;
  }

  @keyframes how-arrow-float {
    0%,
    100% {
      transform: translate(-50%, 0) rotate(-20deg);
    }

    50% {
      transform: translate(-50%, 8px) rotate(-20deg);
    }
  }

  .how-arrow {
    position: relative;
    left: 80%;
    transform: translateX(-50%);
    top: clamp(-35px, -7vw, -65px);

    width: clamp(74px, 44vw, 100px);
    height: auto;
    animation: how-arrow-float 1.6s ease-in-out infinite;
  }

  .how-logo {
    margin-bottom: 5rem;
    margin-top: clamp(-5rem, -8vw, -5rem);
  }

  .how-logo img {
    width: clamp(80px, 20vw, 140px);
  }

  .how-text-4 {
    margin-top: -7rem;
    text-align: center;
    width: 100%;
    max-width: 25ch;
    line-height: 1.4;
  }

  .how-text-4 br {
    display: none;
  }

  .how-text-4 .authory-wrapper,
  .how-text-4 .helps-wrapper,
  .how-text-4 .educators-wrapper {
    display: inline;
  }

  /* VIEW */
  .view {
    padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 2rem)
      clamp(5rem, 10vw, 8rem);
  }

  .view-content {
    margin-left: -4.5rem;
  }

  .view-arrow {
    position: relative;
    top: clamp(-150px, -40vw, -200px);
    width: clamp(60px, 30vw, 86px);
    left: clamp(50px, 25vw, 66px);
    height: auto;
    animation: arrow-float 1.6s ease-in-out infinite;
  }

  .view-switch-wrapper {
    transform: none;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    margin-left: 0;
    margin-top: 0;
  }

  .view-switch {
    padding: 0.5rem 1.2rem;
    gap: 0.8rem;
  }

  .switch-text {
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  }

  .switch-toggle {
    width: clamp(48px, 12vw, 60px);
    height: clamp(24px, 6vw, 30px);
  }

  .switch-circle {
    width: clamp(18px, 5vw, 24px);
    height: clamp(18px, 5vw, 24px);
  }

  .switch-toggle.educator-active .switch-circle {
    transform: translateX(clamp(24px, 6vw, 30px));
  }

  .view-word-switch {
    width: clamp(40px, 10vw, 60px);
    left: 75%;
    transform: translate(0.5rem, 1.5rem);
  }

  .view-image {
    width: 100%;
    height: auto;
  }

  .view-image-text {
    font-size: clamp(0.5rem, 2vw, 0.8rem);
    max-width: 35ch;
    width: 100%;
    padding: 0 clamp(0.5rem, 2vw, 1rem);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    line-height: 1.3;
  }

  .view-tick {
    width: clamp(0.9em, 3vw, 1.2em);
    margin-left: 0.3em;
    margin-top: 0.6em;
  }

  .view-image-container {
    min-height: auto;
    aspect-ratio: auto;
  }

  .view-image-container .view-image {
    transform: scale(1.05);
    transform-origin: center;
  }

  .view-image-container.is-student .view-image {
    content: url("/images/student-mobile.svg");
  }

  .view-image-container.is-student .view-image-text {
    max-width: 30ch;
    width: 100%;
    margin-inline: auto;
    font-size: 0.95rem;
    text-align: left;
  }

  .view-image-container.is-student .view-image-text > span:first-child {
    text-align: justify;
    display: inline;
  }

  .view-image-container.is-student .view-tick {
    display: block;
    margin-top: 0.8rem;
    margin-left: auto;
    width: 2em;
    height: auto;
  }

  .view-image-container.is-professor .view-image {
    content: url("/images/professor-mobile.svg");
  }

  .view-image-container.is-professor .prof-card > * {
    margin-left: 1rem;
  }

  .view-image-container.is-professor .prof-card {
    font-size: 1em;
    max-width: 34ch;
  }

  .view-image-container.is-professor .prof-name {
    font-size: 1em;
  }

  .view-image-container.is-professor .prof-task {
    font-size: 0.8em;
  }

  .view-image-container.is-professor .prof-row,
  .view-image-container.is-professor .prof-alert {
    font-size: 1em;
  }

  .view-image-container.is-professor .prof-row ul {
    font-size: 1em;
  }

  .view-image-container.is-professor .prof-alert {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .view-image-container.is-professor .prof-icon {
    width: 24px;
    height: 24px;
  }

  .view-image-container.is-professor .prof-subject {
    font-size: 1em; /* ajusta si hace falta */
    margin-top: 0.6rem;
  }

  .view-image-container.is-professor .prof-name {
    margin-top: 0;
  }

  .view-professor-content {
    padding: 0.5rem;
  }

  .prof-card {
    width: 95%;
    max-width: 100%;
    padding: 1rem 0.8rem;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    border-radius: 1rem;
  }

  .prof-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-inline: 0;
    margin-top: 1rem;
  }

  .prof-col-left,
  .prof-col-right {
    padding-left: 0.5rem;
    gap: 0.8rem;
  }

  .prof-col-right {
    transform: none;
  }

  .prof-subject {
    margin-left: 0.5rem;
    font-size: clamp(0.65rem, 2.2vw, 0.8rem);
    margin-bottom: 0.3rem;
  }

  .prof-name {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-left: 0.5rem;
  }

  .prof-task {
    margin-left: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  }

  .prof-row {
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    font-size: clamp(0.65rem, 2.3vw, 0.8rem);
  }

  .prof-icon {
    width: 20px;
    height: 20px;
  }

  .prof-icon-alert {
    width: 30px;
    height: 30px;
  }

  .prof-row ul {
    margin: 0.3rem 0 0 0.2rem;
    font-size: clamp(0.6rem, 2.1vw, 0.75rem);
  }

  .prof-alert {
    gap: 0.4rem;
  }

  /* FORM */
  .form {
    padding: clamp(20px, 2vw, 36px);
  }

  .form-container {
    grid-template-columns: 0.8fr;
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    padding: clamp(24px, 6vw, 32px);
    gap: clamp(20px, 5vw, 28px);
    min-height: auto;
  }

  .form-left {
    transform: none;
  }

  .form-left h2 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    max-width: 10ch;
    transform: translateY(20px);
  }

  .form-underline-left {
    transform: translateX(-50%) translateY(16px) scale(0.7);
    width: clamp(00px, 120vw, 800px);
  }

  .form-exclamation-right {
    transform: translateX(12px) translateY(6px) rotate(-8deg) scale(1.15);
  }

  .input-group {
    flex-direction: row;
    gap: clamp(8px, 2vw, 12px);
  }

  .input-group input {
    flex: 1;
  }

  .input-group,
  .form-right input[type="text"],
  .form-right input[type="email"],
  .occupation,
  .checkbox-group,
  .frc-captcha,
  .form-right button {
    max-width: 100%;
  }

  .form-right form {
    max-width: 270px;
    width: 100%;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .form-right input[type="text"],
  .form-right input[type="email"] {
    padding: clamp(8px, 2vw, 12px) clamp(14px, 3.5vw, 18px);
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }

  /* OCCUPATION + CHECKBOXES (mobile override) */
  .form .occupation {
    padding: 8px 14px;
    margin-top: -4px;
  }

  .form .occupation label,
  .form .occupation span,
  .form .checkbox-group label {
    min-height: 0;
    line-height: 1.2;
  }

  .form .occupation input[type="radio"],
  .form .checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .form .occupation-legend {
    font-size: clamp(0.9rem, 3.5vw, 1rem);
  }

  .form-right button {
    min-height: 44px;
    padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 24px);
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
  }

  .frc-captcha {
    transform: scale(0.55);
    transform-origin: center;
  }
}

/* =========================
   MÓVIL PEQUEÑO (max-width: 480px)
========================= */
@media (width <= 480px) {
  html {
    font-size: clamp(12px, 4vw, 14px);
  }

  .home {
    padding: 0.5rem 0.8rem clamp(1.5rem, 4vw, 2rem);
  }

  .home-inner {
    padding: clamp(0.8rem, 2.5vw, 1.5rem);
  }

  .hero-title {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .authory-logo-vertical {
    width: clamp(160px, 60vw, 250px);
  }

  .how-content {
    font-size: clamp(1.2rem, 6vw, 1.8rem);
  }

  .how-logo img {
    width: clamp(70px, 22vw, 120px);
  }

  .view-image-text {
    font-size: clamp(0.6rem, 3vw, 0.85rem);
    width: 92%;
  }

  .prof-card {
    width: 98%;
    padding: 0.8rem 0.6rem;
    font-size: clamp(0.6rem, 2.8vw, 0.75rem);
  }

  .prof-subject,
  .prof-name,
  .prof-task {
    margin-left: 0.3rem;
  }

  .prof-name {
    font-size: clamp(0.9rem, 4.5vw, 1.1rem);
  }

  .prof-icon {
    width: 16px;
    height: 16px;
  }

  .prof-icon-alert {
    width: 24px;
    height: 24px;
  }

  .form-left h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .form-container {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    padding: clamp(24px, 6vw, 32px);
    gap: clamp(20px, 5vw, 28px);
    min-height: auto;
  }

  .form-right form {
    max-width: 240px;
  }

  .form-exclamation-right {
    right: clamp(-10px, -2vw, -15px);
    width: clamp(28px, 9vw, 40px);
  }
}

/* =========================
   LANDSCAPE EN MÓVILES
========================= */
@media (height <= 600px) and (orientation: landscape) {
  .home {
    min-height: auto;
  }

  .how {
    min-height: auto;
    padding: clamp(2rem, 4vh, 3rem) clamp(1.5rem, 3vw, 2rem);
  }

  .view {
    padding: clamp(2rem, 4vh, 3rem) clamp(1.5rem, 3vw, 2rem)
      clamp(3rem, 6vh, 5rem);
  }

  .form {
    padding: clamp(20px, 4vh, 40px) clamp(30px, 5vw, 60px);
  }

  .form-container {
    min-height: auto;
  }
}
