/* RefertoFutura — Mobile-first CSS
   Purpose: complete mobile-oriented stylesheet for Login, Dashboard, Upload/Elaboration,
   Support and Contacts pages. Dark-tech inspired theme, high contrast, accessible.
*/

:root {
  --primary: #4dabf7;
  --secondary: #9775fa;
  --accent: #20c997;
  --background: #0d1117;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --danger: #fa5252;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

/* Shared components */
.card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s;
}
.btn:hover {
  background: #339af0;
}
.btn-secondary {
  background: var(--secondary);
}
.btn-secondary:hover {
  background: #845ef7;
}
.btn-accent {
  background: var(--accent);
}
.btn-accent:hover {
  background: #12b886;
}
.btn-danger {
  background: var(--danger);
}
.btn-danger:hover {
  background: #e03131;
}

input, select, textarea {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: #0f141a;
  color: var(--text);
}

label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Header & Nav */
.header {
  background: var(--surface);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
}
.header h1 {
  font-size: 1.25rem;
}
.navbar {
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  padding: 0.5rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid #222;
}
.navbar a {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.navbar a.active, .navbar a:hover {
  color: var(--primary);
}

/* 1. Login */
.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}
.login-logo {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 2rem;
  color: var(--primary);
}

/* 2. Dashboard */
.dashboard {
  padding: 1rem;
}
.dashboard .actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 3. Elaborazione */
.upload-container {
  border: 2px dashed var(--muted);
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
  margin-top: 1rem;
}
.upload-container.dragover {
  border-color: var(--primary);
  background: rgba(77,171,247,0.05);
}
/* .progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #222;
  margin-top: 1rem;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
} */

/* progress bar */
.progress-wrapper {
  width: 100%;
  background: #222;
  border-radius: var(--radius);
  margin-top: 1rem;
  height: 12px;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius);
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
  display: block;
  text-align: center;
}

.status-msg {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 4. Supporto */
.support {
  padding: 1rem;
}
.support h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.support .faq-item {
  margin-bottom: 1rem;
}
.support .faq-item h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--primary);
}

/* 5. Contatti */
.contacts {
  padding: 1rem;
}
.contacts h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.contacts .contact-item {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}
.contacts .contact-item span {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: #1b1d1f;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    z-index: 9999;
    color: #fff;
    display: none;
}

#cookie-banner h3 {
    margin-top: 0;
}

.cookie-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cookie-btn {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.cookie-btn.accept {
    background: #4ade80;
    color: #000;
}

.cookie-btn.reject {
    background: #ef4444;
    color: #fff;
}

.cookie-btn.settings {
    background: #374151;
    color: #fff;
}

/* Modal impostazioni cookie */
#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
}

.cookie-settings-box {
    background: #1f2123;
    color: #fff;
    width: 90%;
    max-width: 500px;
    padding: 25px;
    border-radius: 12px;
    margin: 100px auto;
}


/* Responsive tweaks */
@media (min-width: 600px) {
  .container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center; /* centra testo e elementi inline */
  }

  .dashboard .actions {
    flex-direction: row;
  }
  /* Bottoni più eleganti */
  .btn { 
    width: auto;
    max-width: 250px;
    flex: unset;
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: auto;
  }
  /* Aggiungiamo un po’ di respiro sopra e sotto */
  .btn + .btn {
    margin-top: 0.8rem;
  }

  /* Input più piccoli (desktop-friendly) */
  input, select, textarea {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    max-width: 500px;
  }

  form {
    max-width: 500px;
    margin: 0 auto;
  }
}



/* DIALOG SUPPORT */
/* Modal background */
.rf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9000;
  padding: 1rem;
}

/* Modal box */
.rf-modal-content {
  background: var(--surface, #161b22);
  border: 1px solid #1d1f24;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;         /* LIMIT HEIGHT */
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  animation: fadeIn .2s ease;
  overflow: hidden;
}

/* Scroll wrapper for content */
.rf-modal-scroll {
  overflow-y: auto;
  padding: 1.4rem;
}

/* Header */
.rf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rf-modal-header h2 {
  margin: 0;
  color: var(--accent, #4dabf7);
}
.rf-close-btn {
  background: none;
  border: none;
  color: var(--text, #e6edf3);
  font-size: 1.6rem;
  cursor: pointer;
}

/* FAQ section */
.rf-faq h3 {
  margin-top: .5rem;
  color: var(--accent2, #20c997);
}
.rf-faq details {
  margin-top: .6rem;
  background: #111318;
  border-radius: 8px;
  padding: .6rem .8rem;
  border: 1px solid #1a1c22;
}
.rf-faq summary {
  cursor: pointer;
  font-weight: 600;
}
.rf-faq p {
  margin-top: .4rem;
  color: var(--muted, #8b949e);
}

/* Divider */
.rf-divider {
  border: none;
  border-top: 1px solid #222;
  margin: 1rem 0;
}

/* Support form */
.rf-support-form h3 {
  color: var(--accent, #4dabf7);
  margin-bottom: .6rem;
}
.rf-support-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
}
.rf-support-form input,
.rf-support-form textarea {
  width: 100%;
  margin-top: .3rem;
  padding: .7rem;
  border-radius: 8px;
  border: 1px solid #2a2d33;
  background: #0d1117;
  color: var(--text);
  font-size: .95rem;
}

/* Submit button */
.rf-submit-btn {
  width: 100%;
  padding: .8rem;
  background: var(--accent);
  color: #081122;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: .5rem;
}

/* Trigger button (floating) */
.rf-support-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: #081122;
  font-weight: 700;
  padding: .9rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 16px rgba(77,171,247,0.15);
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* END DIALOG SUPPORT */