/*===============================================================
  style.css — design do Manus + melhorias unificadas
===============================================================*/

/*---------------------------------------------------------------
  Variáveis de Tema
---------------------------------------------------------------*/
:root {
  --primary:      #5b3a9a;
  --secondary:    #ffab00;
  --bg:           #f5f5f5;
  --text:         #333;
  --error:        #e53935;
  --warning:      #fb8c00;
  --success:      #43a047;
  --white:        #fff;
  --gray-light:   #f3f3f3;
  --gray:         #dddddd;
  --shadow:       0 4px 12px rgba(0,0,0,0.1);
  --radius:       0.5rem;
  --transition:   0.3s ease;
}

/*---------------------------------------------------------------
  Reset & Base
---------------------------------------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0;
}

/*---------------------------------------------------------------
  Header & Nav
---------------------------------------------------------------*/
header {
  background: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo-text {
  color: var(--white);
  font-size: 1.75rem;
  font-weight: bold;
  text-decoration: none;
  user-select: none;
}
.logo-text .logo-highlight {
  color: var(--secondary);
}
.nav-toggle {
  /* já existe… */
  display: none;              /* mantém como antes */
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--white);
  cursor: pointer;

  /* adicione: */
  padding: 0.5rem 0.75rem;     /* área de clique maior */
  z-index: 1002;               /* acima do header e de tudo */
}

.auth-nav { display: flex; align-items: center; gap: 1rem; }
.nav-links a,
.nav-links button {
  color: var(--white);
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  transition: background-color var(--transition), opacity var(--transition);
}
.nav-links a:hover,
.nav-links button:hover {
  background-color: rgba(255,255,255,0.2);
  opacity: 0.9;
}
.nav-btn {
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  font-weight: bold;
}
@media (max-width: 768px) {
  .auth-nav {
    display: flex;           /* flex para layout de coluna */
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;

    /* substitua display:none por: */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .auth-nav.open {
    max-height: 500px;       /* valor suficiente para todos os links */
  }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .auth-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  .auth-nav.open { display: flex; }
}

/*---------------------------------------------------------------
  Hero Section
---------------------------------------------------------------*/
.hero {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 3rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 2rem;
}
.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.2rem;
  margin: 0 auto 2rem;
  max-width: 800px;
}

/*---------------------------------------------------------------
  Cards & Form Sections
---------------------------------------------------------------*/
.card,
.form-card {
  background: var(--white);
  margin: 2rem auto;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.card:hover,
.form-card:hover {
  transform: translateY(-5px);
}
.card h1,
.form-card h2,
.section h2 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: bold;
}
.section {
  margin: 3rem 0;
}
.section h2 {
  text-align: center;
  position: relative;
}
.section h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--secondary);
  margin: .5rem auto 0;
}

/*---------------------------------------------------------------
  Forms
---------------------------------------------------------------*/
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 600;
  color: var(--primary);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,58,154,0.2);
  outline: none;
}

/*---------------------------------------------------------------
  Buttons
---------------------------------------------------------------*/
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: .75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  text-decoration: none;
  text-align: center;
}
.btn:hover {
  background: #4e2f74;
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--secondary);
}
.btn-primary:hover {
  background: #e69100;
}
.btn-small {
  background: var(--secondary);
  color: var(--white);
  border: none;
  font-size: .85rem;
  padding: .4rem .8rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-small:hover {
  background: #e69100;
}

/*---------------------------------------------------------------
  Modals ajustados
---------------------------------------------------------------*/
.modal {
  display: none;                    /* oculto até o JS exibir */
  position: fixed;                  /* ocupa toda a tela */
  inset: 0;                         /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0, 0, 0, 0.7);   /* fundo semitransparente */
  padding: 1rem;                    /* espaço interno para “sopro” ao redor */
  z-index: 1000;                    /* acima de tudo */
  overflow: hidden;                 /* scroll será no conteúdo, não no backdrop */
}

.modal-content {
  background: var(--white);         /* caixa branca */
  border-radius: var(--radius);     /* bordas arredondadas */
  max-width: 700px;                 /* LARGURA MÁXIMA aumentada */
  width: 90%;                       /* até 90% da viewport em telas pequenas */
  margin: auto;                     /* centraliza horizontalmente e verticalmente */
  position: relative;               /* contexto para o “×” */
  box-shadow: var(--shadow);        /* sombra suave */

  /* — Scroll interno — */
  max-height: calc(100vh - 4rem);   /* deixa 2rem de folga acima e abaixo */
  padding: 2rem;                    /* padding interno */
  overflow-y: auto;                 /* scroll apenas do conteúdo */
}

.modal .close {
  position: absolute;   /* relativo a .modal-content */
  top: 1rem;            /* ajuste conforme seu padding */
  right: 1rem;          /* idem */
  font-size: 1.75rem;   /* tamanho confortável */
  cursor: pointer;
  color: var(--text);
  z-index: 1001;        /* acima do conteúdo */
}
.modal .close:hover {
  color: var(--error);
}




/*---------------------------------------------------------------
  Book & Reservation Items
---------------------------------------------------------------*/
.book-item,
.reservation-item {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  align-items: flex-start;
  transition: transform var(--transition), box-shadow var(--transition);
}
.book-item:hover,
.reservation-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.book-cover {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: calc(var(--radius)/2);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.book-info {
  flex: 1;
}
.book-title {
  margin: 0 0 .5rem 0;
  color: var(--primary);
  font-size: 1.2rem;
}
.book-author,
.book-price,
.book-duration,
.reservation-info p {
  margin: 0 0 .5rem 0;
  font-size: .95rem;
  color: #555;
}
.book-desc {
  margin-top: .75rem;
  font-size: .9rem;
  color: #666;
  line-height: 1.5;
}

/*---------------------------------------------------------------
  Card Actions
---------------------------------------------------------------*/
.card-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
}

/*---------------------------------------------------------------
  Footer
---------------------------------------------------------------*/
footer {
  text-align: center;
  padding: 2rem 0;
  background: var(--primary);
  color: var(--white);
  margin-top: 3rem;
}
.footer-inner {
  padding: 1rem 0;
}
.footer-inner a {
  color: var(--white);
  text-decoration: none;
  margin: 0 .5rem;
  transition: color var(--transition);
}
.footer-inner a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/*---------------------------------------------------------------
  Período de Locação no Modal
---------------------------------------------------------------*/
.periodo-locacao {
  margin-top: 1.5rem;
  background: var(--gray-light);
  padding: 1rem;
  border-radius: var(--radius);
}
.periodo-locacao label {
  display: block;
  margin-bottom: .75rem;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}
.periodo-locacao input {
  margin-left: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--gray);
  border-radius: calc(var(--radius)/2);
  transition: border-color var(--transition);
}
.periodo-locacao input:focus {
  border-color: var(--primary);
  outline: none;
}
#detalhes-periodo-text {
  margin-top: .75rem;
  font-weight: bold;
  color: var(--primary);
}

/*---------------------------------------------------------------
  Features Grid (Como Funciona e Benefícios)
---------------------------------------------------------------*/
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.feature-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform var(--transition);
}
.feature-card:hover {
  transform: translateY(-10px);
}
.feature-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}
.feature-card h3 {
  margin-bottom: 1rem;
}

/*---------------------------------------------------------------
  Animações
---------------------------------------------------------------*/
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
.fade-in {
  animation: fadeIn 0.5s ease-in-out both;
}

/*---------------------------------------------------------------
  Responsividade Fina
---------------------------------------------------------------*/
@media (max-width: 480px) {
  .header-inner,
  .footer-inner {
    flex-direction: column;
  }
  .book-item,
  .reservation-item {
    flex-direction: column;
  }
  .book-cover {
    width: 120px;
    height: 180px;
    margin-bottom: 1rem;
  }
  .card-actions {
    flex-direction: column;
  }
  .btn,
  .btn-small {
    width: 100%;
    margin-bottom: .5rem;
  }
}

/* --- Sticky footer setup --- */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}
/* Sugestão visual para os ícones da nav */
.auth-nav .nav-links a,
.auth-nav .nav-links button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem; /* espaço entre ícone e texto */
  padding: 0.35rem 0.6rem;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.auth-nav .nav-links .nav-icon svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  stroke: currentColor; /* herda cor do texto */
  fill: none;
}

.auth-nav .nav-links .nav-btn {
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
}
