/* =========================================================
   MACHANDE.DE – LANDINGPAGE
   Bereinigte responsive Fassung
   ========================================================= */

/* ---------- Designvariablen ---------- */

:root {
  --background-desktop: url("/images/alba-login-4k-v3.jpg");

  /*
   * Bis das separate Hochformatbild bereitsteht, wird auch im
   * Portrait-Modus das Desktopbild verwendet.
   *
   * Später nur diese Zeile ändern, zum Beispiel:
   * --background-portrait: url("/images/alba-login-portrait-4k.jpg");
   */
  --background-portrait: url("/images/alba-login-portrait-4k.jpg?v=1");

  --page-bg: #050814;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.76);

  --glass-bg: rgba(15, 20, 32, 0.30);
  --glass-bg-hover: rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.20);
  --accent-border: rgba(150, 170, 255, 0.65);

  --radius: 16px;
  --transition: 0.25s ease;
}

/* ---------- Reset / Grundlayout ---------- */

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

html,
body {
  width: 100%;
  height: 100%;
}

html {
  background: var(--page-bg);
}

body {
  position: relative;
  overflow: hidden;

  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background: var(--page-bg);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Hintergrund ---------- */

.background-image {
  position: fixed;
  inset: 0;
  z-index: 0;

  background-image: var(--background-desktop);
  background-size: cover;
  background-position: 46% center;
  background-repeat: no-repeat;
}

/* Seitliche Abdunklung: rechts stärker für den Haupttext */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      rgba(5, 8, 20, 0.08) 0%,
      rgba(5, 8, 20, 0.10) 30%,
      rgba(5, 8, 20, 0.38) 48%,
      rgba(5, 8, 20, 0.70) 68%,
      rgba(5, 8, 20, 0.82) 100%
    );

  backdrop-filter: saturate(55%);
  -webkit-backdrop-filter: saturate(55%);
}

/* Dezente Vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background:
    radial-gradient(
      circle at 72% 44%,
      rgba(255, 255, 255, 0.07),
      transparent 34%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.10),
      transparent 32%,
      transparent 68%,
      rgba(0, 0, 0, 0.44)
    );
}

/* ---------- Seitencontainer ---------- */

.page {
  position: relative;
  z-index: 2;

  width: 100%;
  height: 100%;
}

/* ---------- Kopfzeile ---------- */

.topbar {
  position: absolute;
  top: 32px;
  left: 40px;
  right: 40px;
  z-index: 4;

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

.date-block,
.weather {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.top-right,
.weather {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.weather-text small {
  font-size: 12px;
  opacity: 0.72;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;

  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;

  background: rgba(15, 20, 32, 0.24);
  color: white;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  cursor: pointer;
  transition:
    transform var(--transition),
    background var(--transition);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- Hauptbereich ---------- */

.hero {
  position: absolute;
  top: 0;
  right: 7%;

  width: 58%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding:
    105px
    clamp(30px, 5vw, 100px)
    155px;

  text-align: center;
}

.eyebrow {
  margin-bottom: 20px;

  text-transform: uppercase;
  letter-spacing: 8px;
  font-size: 14px;
  opacity: 0.85;

  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.70);
}

.hero h1 {
  max-width: 100%;

  font-size: clamp(52px, 6vw, 104px);
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
  white-space: nowrap;

  text-shadow:
    0 3px 20px rgba(0, 0, 0, 0.55),
    0 0 35px rgba(0, 0, 0, 0.20);
}

.divider {
  position: relative;

  width: 180px;
  height: 1px;
  margin-top: 22px;

  background: rgba(255, 255, 255, 0.35);
}

.divider span {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: white;

  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px rgba(140, 160, 255, 0.90);
}

.subtitle {
  margin-top: 26px;

  font-size: 20px;
  opacity: 0.82;

  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

/* ---------- Login-Schaltfläche ---------- */

.login-button {
  width: 220px;
  height: 58px;
  margin-top: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;

  color: white;
  text-decoration: none;
  font-size: 19px;

  border: 1px solid var(--accent-border);
  border-radius: var(--radius);

  background: rgba(20, 26, 42, 0.34);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 0 22px rgba(100, 130, 255, 0.35),
    inset 0 0 18px rgba(255, 255, 255, 0.04);

  transition:
    transform var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.login-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);

  box-shadow:
    0 0 34px rgba(120, 150, 255, 0.55),
    inset 0 0 20px rgba(255, 255, 255, 0.07);
}

.login-button img {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
}

.login-arrow {
  font-size: 26px;
  line-height: 1;
  opacity: 0.80;
}

/* ---------- Karten ---------- */

.cards {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 3;

  width: min(900px, calc(100% - 80px));

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;

  transform: translateX(-50%);
}

.card {
  min-width: 0;
  height: 82px;
  padding: 12px 18px;

  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;

  color: white;
  text-decoration: none;
  text-align: left;

  border: 1px solid var(--glass-border);
  border-radius: var(--radius);

  background: var(--glass-bg);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.24),
    inset 0 0 18px rgba(255, 255, 255, 0.03);

  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  background: var(--glass-bg-hover);
  border-color: rgba(150, 170, 255, 0.45);
}

.card-icon,
.security-icons {
  grid-column: 1;
  grid-row: 1 / 3;

  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon {
  border: 1px solid rgba(150, 170, 255, 0.55);
  border-radius: 50%;
  font-size: 17px;
}

.security-icons {
  gap: 5px;
}

.security-icons img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.card h2 {
  grid-column: 2;

  overflow: hidden;

  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card p {
  grid-column: 2;

  overflow: hidden;

  font-size: 13px;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Sicherheitskarte */
.card:nth-child(3) {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
}

.card:nth-child(3) .security-icons {
  grid-column: 2;
  grid-row: 1;

  width: auto;
  height: auto;
  gap: 8px;
  justify-content: flex-end;
}

.card:nth-child(3) .security-icons img {
  width: 24px;
  height: 24px;
}

.card:nth-child(3) h2 {
  grid-column: 1;
  grid-row: 1;
}

.card:nth-child(3) p {
  grid-column: 1 / 3;
  grid-row: 2;
}

/* ---------- Helles Design ---------- */

body[data-theme="light"]::before {
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0%,
      rgba(255, 255, 255, 0.04) 30%,
      rgba(10, 15, 25, 0.22) 50%,
      rgba(10, 15, 25, 0.50) 72%,
      rgba(10, 15, 25, 0.62) 100%
    );

  backdrop-filter: saturate(75%);
  -webkit-backdrop-filter: saturate(75%);
}

body[data-theme="light"]::after {
  background:
    radial-gradient(
      circle at 72% 44%,
      rgba(255, 255, 255, 0.17),
      transparent 38%
    ),
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05),
      transparent 35%,
      rgba(0, 0, 0, 0.25)
    );
}

body[data-theme="light"] .card,
body[data-theme="light"] .login-button,
body[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

body[data-theme="light"] .card p {
  color: rgba(255, 255, 255, 0.84);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* ---------- Kleinere Desktop-/Tablet-Landschaft ---------- */

@media (max-width: 1200px) and (orientation: landscape) {
  .hero {
    right: 6%;
    width: 60%;
    padding-right: 32px;
    padding-left: 32px;
  }

  .cards {
    width: min(900px, calc(100% - 48px));
  }

  .card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .card h2 {
    font-size: 15px;
  }

  .card p {
    font-size: 12px;
  }
}

/* ---------- iPad / Tablet im Hochformat ---------- */

@media (max-width: 1100px) and (orientation: portrait) {
  html,
  body {
    min-height: 100%;
    height: auto;
  }

  body {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .background-image {
    background-image: var(--background-portrait);
    background-position: center center;
  }

  body::before {
    background:
      linear-gradient(
        to bottom,
        rgba(5, 8, 20, 0.28) 0%,
        rgba(5, 8, 20, 0.48) 48%,
        rgba(5, 8, 20, 0.70) 100%
      );

    backdrop-filter: saturate(58%);
    -webkit-backdrop-filter: saturate(58%);
  }

  body::after {
    background:
      radial-gradient(
        circle at 50% 42%,
        rgba(255, 255, 255, 0.08),
        transparent 38%
      ),
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.10),
        transparent 28%,
        rgba(0, 0, 0, 0.38)
      );
  }

  .page {
    min-height: 100vh;
    height: auto;
    padding-bottom: max(30px, env(safe-area-inset-bottom));
  }

  .topbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;

    padding:
      calc(22px + env(safe-area-inset-top))
      24px
      8px;

    gap: 18px;
    align-items: flex-start;
  }

  .date-block,
  .weather {
    font-size: 16px;
  }

  .hero {
    position: relative;
    top: auto;
    right: auto;

    width: 100%;
    height: auto;
    min-height: 560px;

    padding: 72px 28px 44px;

    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .eyebrow {
    margin-bottom: 17px;
    font-size: 13px;
    letter-spacing: 6px;
  }

  .hero h1 {
    font-size: clamp(58px, 9.5vw, 88px);
    letter-spacing: -1px;
    white-space: nowrap;
  }

  .divider {
    width: 170px;
    margin-top: 19px;
  }

  .subtitle {
    max-width: 650px;
    margin-top: 22px;
    font-size: clamp(18px, 2.4vw, 23px);
  }

  .login-button {
    width: min(280px, 100%);
    margin-top: 26px;
  }

  .cards {
    position: relative;
    left: auto;
    bottom: auto;

    width: min(960px, calc(100% - 40px));
    margin: -42px auto 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));

    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

    transform: none;
  }

  .card {
    width: 100%;
    height: 72px;
    min-height: 72px;
    padding: 9px 12px;
  }

  .card-icon,
  .security-icons {
    width: 32px;
    height: 32px;
  }

  .security-icons {
    gap: 5px;
  }

  .security-icons img {
    width: 19px;
    height: 19px;
  }

  .card:nth-child(3) .security-icons img {
    width: 20px;
    height: 20px;
  }

  .card h2 {
    overflow: visible;
    font-size: 13px;
    white-space: normal;
    text-overflow: clip;
  }

  .card p {
    overflow: visible;
    font-size: 10.5px;
    white-space: normal;
    text-overflow: clip;
  }

  .card h2,
  .card p {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
}

/* ---------- Smartphones im Hochformat ---------- */

@media (max-width: 820px) and (orientation: portrait) {
  .background-image {
    background-position: center center;
  }

  body::before {
    background:
      linear-gradient(
        to bottom,
        rgba(5, 8, 20, 0.34) 0%,
        rgba(5, 8, 20, 0.55) 46%,
        rgba(5, 8, 20, 0.76) 100%
      );
  }

  .page {
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;

    padding:
      calc(16px + env(safe-area-inset-top))
      18px
      6px;

    gap: 12px;
  }

  .date-block,
  .weather {
    font-size: 14px;
    line-height: 1.25;
  }

  .top-right {
    gap: 8px;
  }

  .weather-text small {
    display: none;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .hero {
    min-height: 430px;
    padding: 34px 18px 48px;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 4px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(36px, 10.8vw, 50px);
    letter-spacing: -0.8px;
    white-space: nowrap;
  }

  .divider {
    width: 140px;
    margin-top: 18px;
  }

  .subtitle {
    max-width: 330px;
    margin-top: 18px;
    font-size: 16px;
  }

  .login-button {
    width: min(230px, 100%);
    height: 56px;
    margin-top: 24px;
  }

  .cards {
    width: calc(100% - 28px);
    margin: 0 auto;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));

    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .card:nth-child(2) {
    display: none;
  }

  .card {
    min-height: 68px;
    padding: 8px 10px;
  }

  .card-icon,
  .security-icons {
    width: 30px;
    height: 30px;
  }

  .security-icons {
    gap: 5px;
  }

  .security-icons img {
    width: 18px;
    height: 18px;
  }

  .card:nth-child(3) .security-icons img {
    width: 19px;
    height: 19px;
  }

  .card:nth-child(3) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .card:nth-child(3) .security-icons {
    align-self: start;
  }

  .card h2 {
    font-size: 13.5px;
  }

  .card p {
    font-size: 11px;
  }
}

/* ---------- Sehr kleine Smartphones ---------- */

@media (max-width: 430px) and (orientation: portrait) {
  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .date-block {
    max-width: 210px;
  }

  .hero {
    min-height: 410px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero h1 {
    font-size: clamp(34px, 10.4vw, 46px);
  }

  .subtitle {
    max-width: 290px;
  }

  .cards {
    width: calc(100% - 18px);
    gap: 6px;
  }
}

/* ---------- Smartphones / kleine Tablets quer ---------- */

@media (max-height: 520px) and (orientation: landscape) {
  html,
  body {
    min-height: 100%;
    height: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .background-image {
    inset:
      0
      calc(-1 * env(safe-area-inset-right))
      0
      calc(-1 * env(safe-area-inset-left));
    background-position: center center;
  }

  .page {
    min-height: 100vh;
    height: auto;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .topbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;

    padding:
      calc(10px + env(safe-area-inset-top))
      calc(18px + env(safe-area-inset-right))
      4px
      calc(18px + env(safe-area-inset-left));
  }

  .date-block,
  .weather {
    font-size: 13px;
  }

  .weather-text small {
    display: none;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .hero {
    position: relative;
    top: auto;
    right: auto;

    width: 100%;
    height: auto;
    min-height: 265px;

    padding:
      8px
      calc(24px + env(safe-area-inset-right))
      24px
      calc(24px + env(safe-area-inset-left));

    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 10px;
    letter-spacing: 4px;
  }

  .hero h1 {
    max-width: calc(
      100vw -
      env(safe-area-inset-left) -
      env(safe-area-inset-right) -
      48px
    );
    font-size: clamp(34px, 5.9vw, 52px);
    letter-spacing: -0.8px;
    white-space: nowrap;
  }

  .divider {
    width: 135px;
    margin-top: 13px;
  }

  .subtitle {
    max-width: min(500px, calc(100vw - 48px));
    margin-top: 13px;
    font-size: 14px;
  }

  .login-button {
    width: 200px;
    height: 50px;
    margin-top: 15px;
    font-size: 17px;
  }

  .cards {
    position: relative;
    left: auto;
    bottom: auto;

    width: calc(
      100% -
      env(safe-area-inset-left) -
      env(safe-area-inset-right) -
      32px
    );

    margin: 0 auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));

    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

    transform: none;
  }

  .card {
    height: 74px;
    min-height: 74px;
    padding: 10px 12px;
  }

  .card-icon,
  .security-icons {
    width: 32px;
    height: 32px;
  }

  .card h2 {
    font-size: 13px;
  }

  .card p {
    font-size: 11px;
  }

  .card:nth-child(3) .security-icons img {
    width: 20px;
    height: 20px;
  }
}

/* ---------- Bewegungsreduktion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   PORTRAIT-FEINSCHLIFF
   iPad: Karten näher an den Login-Button
   iPhone: Karten weiter Richtung unteren Bildschirmrand
   ========================================================= */

/* iPad / größere Tablets im Hochformat */
@media (min-width: 600px) and (max-width: 820px) and (orientation: portrait) {
  /* Etwas mehr Luft zwischen Untertitel und Login */
  .login-button {
    margin-top: 36px;
  }

  /*
   * Die Karten bleiben kompakt, rücken aber etwas nach unten.
   * Dadurch entsteht ein klarerer Abstand zum Login-Button.
   */
  .cards {
    width: min(720px, calc(100% - 96px));
    margin-top: -65px;
    gap: 12px;
  }

  .card {
    min-height: 66px;
    padding: 8px 12px;
  }

  .card-icon,
  .security-icons {
    width: 30px;
    height: 30px;
  }

  .card h2 {
    font-size: 13px;
  }

  .card p {
    font-size: 10.5px;
  }
}

/* iPhone / schmale Smartphones im Hochformat */
@media (max-width: 599px) and (orientation: portrait) {
  /*
   * Textblock und Login etwas nach oben:
   * Alba bleibt dadurch im sichtbaren Mittelbereich freier.
   */
  .hero {
    transform: translateY(-34px);
  }

  /*
   * Die beiden unteren Karten erhalten etwa eine Kartenhöhe
   * zusätzlichen Abstand zum Login und rücken zugleich näher
   * an die untere Safari-Leiste.
   */
  .cards {
    width: calc(100% - 28px);
    margin-top: clamp(128px, 15vh, 165px);
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
}
/* Wetteranzeige ohne Symbol, Text linksbündig */
#weatherIcon {
  display: none;
}

.weather {
  gap: 0;
}

.weather-text {
  align-items: flex-start;
  text-align: left;
}