/* =========================================================
   CONTACT PAGE – Chesnut Energy (Glass Form) — v3
   - Desktop form sits lower
   - Dropdown is dark
   - Mobile is not cut off
   - Contact info order on mobile: Email → Phone → Address
   - Labels consistent
========================================================= */

:root{
  --brand-orange: #EF7A18;
  --glass-bg: rgba(0,0,0,0.58);
  --glass-border: rgba(255,255,255,0.14);
  --glass-text: rgba(255,255,255,0.92);
  --glass-soft: rgba(255,255,255,0.72);
}

/* =========================
   PAGE WRAPPER
========================= */
.page-contact{
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* =========================
   BACKGROUND IMAGE
========================= */
.page-contact .contact-bg{
  position: absolute;
  inset: 0;
  height: 100%;
}

.page-contact .contact-bg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* overlay */
.page-contact::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 1;
}

/* =========================
   CONTENT LAYOUT
========================= */
.page-contact .container{
  position: relative;
  z-index: 2;

  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;

  /* lower placement on desktop */
  padding-top: clamp(170px, 20vh, 290px);
  padding-bottom: 56px;
}

.page-contact .contact-wrapper{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;

  display: flex;
  justify-content: flex-end;
  box-sizing: border-box;
}

.page-contact .contact-layout{
  display: flex;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   FORM CARD
========================= */
.page-contact .contact-form-section{
  width: 100%;
  max-width: 460px;
  margin-top: 120px;

  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;

  padding: 20px 18px;
  box-sizing: border-box;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow:
    0 30px 70px rgba(0,0,0,0.45),
    0 10px 24px rgba(0,0,0,0.25);

  color: var(--glass-text);
}

.page-contact .contact-form-section h2{
  font-size: 1.55rem;
  margin: 0 0 6px 0;
  color: var(--brand-orange);
}

.page-contact .contact-intro-small{
  font-size: 0.92rem;
  color: var(--glass-soft);
  margin: 0 0 14px 0;
  line-height: 1.5;
}

/* =========================
   FORM
========================= */
.page-contact .contact-form{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-contact .form-row{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 600px){
  .page-contact .form-row{ flex-direction: row; }
  .page-contact .form-group{ flex: 1; }
}

.page-contact .form-group{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-contact .form-group label{
  font-size: 0.80rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.page-contact .form-group input,
.page-contact .form-group select,
.page-contact .form-group textarea{
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.92);
  font-size: 0.92rem;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.page-contact .form-group input:focus,
.page-contact .form-group select:focus,
.page-contact .form-group textarea:focus{
  border-color: rgba(239,122,24,0.70);
  box-shadow: 0 0 0 3px rgba(239,122,24,0.22);
}

.page-contact .form-group textarea{
  min-height: 90px;
  resize: vertical;
}

/* dropdown dark */
.page-contact .form-group select{
  background-color: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
}

.page-contact .form-group select option{
  background: #0b0b0b;
  color: #ffffff;
}

/* =========================
   CONTACT INFO
========================= */
.page-contact .form-contact-info{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.86rem;
}

.page-contact .contact-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 22px;
  row-gap: 12px;
  align-items: start;
}

.page-contact .contact-item{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* labels consistent */
.page-contact .contact-item strong{
  display: block;
  font-weight: 700;
  margin: 0;
  color: rgba(255,255,255,0.86);
}

.page-contact .contact-address{
  line-height: 1.35;
  color: rgba(255,255,255,0.72);
}

.page-contact .form-contact-info a{
  color: rgba(239,122,24,0.95);
  text-decoration: none;
}

.page-contact .form-contact-info a:hover{
  text-decoration: underline;
}

/* Desktop placement:
   Email left, Phone right, Address full width */
.page-contact .contact-item--email{ grid-column: 1; }
.page-contact .contact-item--phone{ grid-column: 2; }
.page-contact .contact-item--address{ grid-column: 1 / -1; }

/* =========================
   BUTTON
========================= */
.page-contact .btn{
  margin-top: 8px;
  align-self: center;
  padding: 11px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-contact .btn-primary{
  background: var(--brand-orange);
  color: #000;
}

.page-contact .btn-primary:hover{
  opacity: 0.92;
}

/* success */
.page-contact .contact-form-section .form-success{
  margin-top: 14px;
  padding: 14px 16px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;

  background: rgba(16, 92, 52, 0.35);
  color: rgba(210,255,228,0.95);
  border: 1px solid rgba(210,255,228,0.25);
  border-radius: 10px;
}

.page-contact .contact-form-section .success-title{
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.page-contact .contact-form-section .success-subtitle{
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 4px;
}

/* =========================
   MOBILE (≤ 999px)
========================= */
@media (max-width: 999px){

  :root{
    /* adjust this number if your header is taller/shorter */
    --mobile-header-offset: 60px;
  }

  .page-contact::before{
    background: rgba(0,0,0,0.58);
  }

  .page-contact{
    overflow: visible;
  }

  .page-contact .container{
    justify-content: center;

    /* keep page scrollable and add bottom breathing room */
    padding-top: 0;
    padding-bottom: 70px;

    min-height: 100svh; /* better on mobile browsers */
    height: auto;
  }

  .page-contact .contact-wrapper{
    padding: 0 18px;
    justify-content: center;
    width: 100%;
  }

  .page-contact .contact-layout{
    justify-content: center;
    width: 100%;
  }

  .page-contact .contact-form-section{
    width: 100%;
    max-width: 640px;
    padding: 18px 16px;
    border-radius: 16px;

    /* THIS creates the visible gap under the sticky header */
    margin: var(--mobile-header-offset) auto var(--mobile-header-offset);

    overflow: hidden;
  }

  .page-contact .contact-form-section *{
    box-sizing: border-box;
  }

  /* Contact info stacked order: Email → Phone → Address */
  .page-contact .contact-grid{
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .page-contact .contact-item--email{ order: 1; }
  .page-contact .contact-item--phone{ order: 2; }
  .page-contact .contact-item--address{ order: 3; }
}
