/* /public/css/login.css
   Login – mobile-first, app-like
*/

:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --bg: #00146d;
  --panel: rgba(255,255,255,0.06);
  --panel-border: rgba(255,255,255,0.65);

  --text: #ffffff;
  --muted: rgba(255,255,255,0.82);

  --btn: #FE00F6;
  --btn-hover: #d400d0;

  --radius: 16px;
  --shadow: 0px 10px 26px rgba(0, 0, 0, 0.35);

  --maxw: 420px;
}

/* Reset */
*{ box-sizing: border-box; }
html, body{ height: 100%; margin: 0; padding: 0; }

body{
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  text-align: center;

  /* Mobile-safe height */
  min-height: 100dvh;
  padding-top: calc(18px + var(--safe-top));
  padding-bottom: calc(18px + var(--safe-bottom));
  padding-left: 14px;
  padding-right: 14px;

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

@supports not (min-height: 100dvh){
  body{ min-height: 100vh; }
}

/* Container: card centrata e leggibile */
.container{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* Logo */
img{
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  margin: 0 auto 14px auto;
}

/* Sottotitolo */
h2{
  font-family: 'Montserrat', sans-serif;
  color: var(--muted);
  margin: 10px 0 18px 0;
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.2px;
}

/* Box login */
.login-box{
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  text-align: left;
}

/* Label */
.login-box label{
  display: block;
  margin: 12px 0 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

/* Input */
.login-box input{
  width: 100%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-radius: 12px;

  padding: 14px 14px;
  font-size: 16px; /* IMPORTANTISSIMO: evita zoom iOS */
  line-height: 1.2;

  outline: none;
}

.login-box input::placeholder{
  color: rgba(255,255,255,0.65);
}

.login-box input:focus{
  border-color: rgba(92,201,250,0.75);
  box-shadow: 0 0 0 3px rgba(92,201,250,0.20);
}

/* Bottone */
.login-box button{
  width: 100%;
  margin-top: 16px;

  border: 0;
  border-radius: 12px;
  padding: 14px 14px;

  background: var(--btn);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.login-box button:hover{ background: var(--btn-hover); }
.login-box button:active{ transform: translateY(1px); }

/* Forgot password */
.forgot-password{
  margin-top: 14px;
  text-align: center;
}

.forgot-password a{
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.forgot-password a:hover{
  text-decoration: underline;
}

/* Animazione logo (la tua) */
.animate-logo{
  animation: spinEaseBounce 3s ease-in-out infinite;
}

@keyframes spinEaseBounce{
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(400deg); }
  60%  { transform: rotate(355deg); }
  75%  { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

/* Desktop / schermi grandi: più aria */
@media (min-width: 768px){
  body{
    padding-left: 20px;
    padding-right: 20px;
  }

  .login-box{
    padding: 22px 20px;
  }

  h2{
    font-size: 1.15rem;
  }
}

/* Evita “salti” strani: meglio avere un po’ di spazio sotto */
.container{
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Su mobile: lascia che il contenuto possa scorrere se serve */
@media (max-width: 768px){
  body{
    overflow: auto; /* così se la tastiera copre, puoi comunque scrollare */
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================================
   PATCH: Mobile APP-LIKE (bigger + spaced)
   Incolla in fondo a /public/css/login.css
   ========================================= */

@media (max-width: 768px){
  :root{
    /* card più larga e testi più grossi */
    --maxw: 520px;

    /* ombra un filo più “app” */
    --shadow: 0px 14px 34px rgba(0, 0, 0, 0.42);

    /* arrotondamento più app-like */
    --radius: 22px;
  }

  body{
    /* più “respiro” laterale e sopra */
    padding-left: 48px;
    padding-right: 48px;
    padding-top: calc(26px + var(--safe-top));
    padding-bottom: calc(18px + var(--safe-bottom));

    /* base font generale più grande */
    font-size: 18px;
  }

  /* Logo più grande */
  img{
    max-width: 278px;
    margin-bottom: 18px;
  }

  /* Sottotitolo più leggibile */
  h2{
    font-size: 1.25rem;
    margin: 12px 0 22px 0;
    letter-spacing: 0.3px;
  }

  /* Card più “importante” */
  .login-box{
    padding: 24px 18px;
    border-radius: var(--radius);
    text-align: left;
  }

  /* Label più grandi */
  .login-box label{
    font-size: 1.05rem;
    margin: 16px 0 8px 0;
  }

  /* Input più alti e grandi */
  .login-box input{
    padding: 18px 16px;
    border-radius: 16px;

    /* IMPORTANT: mantieni >=16px per iOS (qui è 18) */
    font-size: 18px;
    line-height: 1.15;
  }

  /* Bottone più alto, “primary app button” */
  .login-box button{
    margin-top: 20px;
    padding: 18px 16px;
    border-radius: 16px;

    font-size: 1.15rem;
    font-weight: 700;
  }

  .forgot-password{
    margin-top: 18px;
  }

  .forgot-password a{
    font-size: 1.05rem;
  }
}

@media (max-width: 768px){
  .container{
    max-width: 560px; /* un filo più largo */
  }

  .login-box{
    width: 100%;
  }
}

@media (max-width: 768px){
  .login-box{
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .login-box input{
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.30);
  }
}