/* Custom Design for ePower-House Redesign */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap");

body {
  font-family: "Montserrat", sans-serif;
  background-color: #ffffff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
}

/* Header */
.header-logo {
  margin-top: 40px; /* More space from top */
  margin-bottom: 10px;
  text-align: left; /* Align left as per mockup */
  padding-left: 20px;
}

.header-logo img {
  max-width: 120px;
}

/* Main Circle Container */
.main-circle-container {
  position: relative;
  width: 100%;
  max-width: 380px; /* Slightly larger */
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto; /* Center horizontally */
}

.circle-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #76d7c4; /* Light teal */
  border-radius: 50%;
  opacity: 0.2;
  z-index: 1;
}

.circle-bg-inner {
  position: absolute;
  width: 85%;
  height: 85%;
  background-color: #48c9b0; /* Teal */
  border-radius: 50%;
  opacity: 0.8;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 20px;
}

.voting-box-img {
  width: 150px;
  margin-bottom: 10px;
  z-index: 3;
}

.app-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-subtitle {
  font-size: 12px;
  font-weight: 400;
  max-width: 80%;
  line-height: 1.4;
}

/* Form Section */
.form-section {
  width: 100%;
  max-width: 350px;
  padding: 0 30px; /* Increased side padding */
  text-align: center;
  margin: 0 auto;
}

.form-label {
  color: #2ecc71; /* Green */
  font-weight: 700;
  font-size: 13px; /* Slightly smaller */
  margin-bottom: 20px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group-custom {
  position: relative;
  margin-bottom: 25px;
}

.input-group-custom input {
  width: 100%;
  padding: 15px 15px 15px 45px;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.input-group-custom input:focus {
  border-color: #2ecc71;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #2ecc71;
  font-size: 18px;
}

.btn-login-custom {
  background-color: #00b300; /* Vibrant Green */
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-login-custom:hover {
  background-color: #009900;
  transform: translateY(-2px);
}

.btn-login-custom i {
  margin-left: 10px;
}

/* Request Access Code Section */
.request-section {
  width: 100%;
  margin-top: 20px;
  text-align: left;
}

.request-toggle {
  color: #00b300;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-bottom: 15px;
}

.request-toggle i {
  margin-left: 5px;
  transition: transform 0.3s;
}

.request-toggle.active i {
  transform: rotate(180deg);
}

.request-form {
  margin-top: 10px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Radio Button Styling */
.radio-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.radio-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 16px; /* Increased font size */
  font-weight: 600;
  color: #555;
  user-select: none;
}

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 24px; /* Larger square */
  width: 24px;
  background-color: #eee;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.radio-container:hover input ~ .checkmark {
  background-color: #ccc;
}

.radio-container input:checked ~ .checkmark {
  background-color: #00b300; /* Green background when checked */
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked ~ .checkmark:after {
  display: block;
}

/* Checkmark indicator (White tick) */
.radio-container .checkmark:after {
  left: 9px;
  top: 5px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.input-small input {
  padding: 10px 15px;
  font-size: 13px;
  height: 40px;
}

.btn-proceed-custom {
  background-color: #00b300;
  color: white;
  border: none;
  padding: 8px 30px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-proceed-custom:hover {
  background-color: #009900;
}

/* Footer */
.footer-custom {
  margin-top: auto;
  margin-bottom: 20px;
  font-size: 10px;
  color: #2ecc71;
  font-weight: 600;
}

/* Modal/Overlay Styles */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.custom-modal {
  background-color: white;
  width: 90%;
  max-width: 320px;
  border-radius: 15px;
  padding: 25px;
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.modal-text {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 20px;
}

.highlight-text {
  color: #00b300;
  font-weight: 700;
}

.error-text {
  color: #e74c3c;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-modal {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-cancel {
  background-color: #e0e0e0;
  color: #555;
}

.btn-confirm {
  background-color: #00b300;
  color: white;
}

/* Mobile First Adjustments */
@media (max-width: 575.98px) {
  .page-container {
    padding: 0 18px 24px;
    align-items: center;
    min-height: 100vh; /* Fill viewport height */
    justify-content: flex-start;
  }

  .header-logo {
    width: 100%;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-left: 0;
    display: flex;
    justify-content: center;
  }

  .header-logo img {
    max-width: 90px;
    height: auto;
  }

  .main-circle-container {
    max-width: 320px;
    height: 320px;
    margin: 10px auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .circle-bg-inner {
    width: 80%;
    height: 80%;
    padding: 16px;
  }

  .voting-box-img {
    width: 120px;
    margin-bottom: 8px;
  }

  .app-title {
    font-size: 26px;
  }

  .app-subtitle {
    font-size: 12px;
    max-width: 90%;
  }

  .form-section {
    padding: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .input-group-custom input {
    font-size: 15px;
  }

  .input-group-custom,
  .btn-login-custom,
  .btn-proceed-custom,
  .request-section,
  .request-form {
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .btn-login-custom,
  .btn-proceed-custom {
    width: 100%;
  }

  .request-section {
    margin-top: 24px;
    text-align: center;
  }

  .radio-container {
    font-size: 15px;
  }

  .radio-group {
    align-items: center;
  }

  .request-toggle {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .custom-modal-overlay {
    padding: 0 16px;
  }

  .custom-modal {
    width: 100%;
    max-width: none;
    padding: 20px;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0 auto;
    text-align: center; /* Center text for mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .modal-actions {
    flex-direction: column;
    align-items: center; /* Center buttons */
    gap: 10px;
  }

  .btn-modal {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .footer-custom {
    margin-top: auto; /* Push footer to bottom */
    text-align: center;
  }
}

/* Responsive adjustments */
@media (max-height: 700px) {
  .main-circle-container {
    height: 300px;
    max-width: 300px;
  }
  .voting-box-img {
    width: 100px;
  }
  .app-title {
    font-size: 22px;
  }
}

/* Tablet Styles (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .main-circle-container {
    max-width: 450px;
    height: 450px;
  }

  .app-title {
    font-size: 36px;
  }

  .form-section {
    max-width: 450px;
  }
}

/* Desktop Styles */
@media (min-width: 992px) {
  .page-container {
    display: grid;
    grid-template-columns: 45% 55%; /* Adjusted ratio */
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    align-items: center;
  }

  /* Left Column Elements */
  .header-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-left: 50px;
    margin-top: 30px;
    text-align: left;
    padding-left: 0; /* Reset mobile padding */
  }

  .form-section {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    align-self: center; /* Vertically center */
    text-align: left;
    max-width: 400px;
    width: 100%;
    padding-left: 50px; /* Add some padding */
    padding-right: 0; /* Reset mobile padding */
    margin: 0; /* Reset mobile margin */
  }

  .form-section .form-label {
    text-align: left;
  }

  .footer-custom {
    grid-column: 1;
    grid-row: 3;
    justify-self: start; /* Align with logo */
    margin-left: 50px;
    margin-bottom: 20px;
  }

  /* Right Column (Illustration) */
  .main-circle-container {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 100%;
    height: 100%;
    max-width: none;
    margin-bottom: 0;

    /* Desktop Background Image */
    background: url("../images/homepage/semi-circle.png") no-repeat right center;
    background-size: cover; /* Cover to fill height */
    background-position: right center;
  }

  /* Hide Mobile Circle Backgrounds */
  .circle-bg {
    display: none;
  }

  .circle-bg-inner {
    position: relative; /* Reset position */
    width: auto;
    height: auto;
    background-color: transparent; /* Remove background */
    border-radius: 0;
    opacity: 1;
    padding: 0;

    /* Center content in the right panel */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 15%; /* Offset for the semi-circle */
  }

  .voting-box-img {
    width: 250px; /* Larger on desktop */
  }

  .app-title {
    font-size: 52px; /* Larger on desktop */
    margin-bottom: 15px;
  }

  .app-subtitle {
    font-size: 18px;
    max-width: 450px;
  }
}
