/* style/login.css */

/* Custom Properties based on provided color palette */
:root {
  --primary-color: #11A84E; /* Main color */
  --secondary-color: #22C768; /* Auxiliary color */
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --card-bg: #11271B;
  --main-bg: #08160F;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green: #0A4B2C;

  /* Fallback for body background if shared.css doesn't define --site-bg */
  --site-bg: var(--main-bg);
}

body {
  background-color: var(--site-bg); /* Inherited from shared.css, ensures proper background */
  color: var(--text-main); /* Default text color for the page */
}

/* Main page container */
.page-login {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Hero section for login form */
.page-login__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  /* 🚨 页头由 shared 的 body { padding-top: var(--header-offset); } 承担；此处仅用小额顶距，禁止 var(--header-offset) 以免双倍空白 */
  padding-top: 10px; /* As per instruction, small top padding */
  background-color: var(--card-bg); /* Use a dark background for the hero section */
  border-radius: 12px;
  margin-bottom: 40px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden; /* Ensure image doesn't overflow rounded corners */
}

.page-login__hero-image {
  width: 100%;
  height: auto;
  margin-bottom: 30px;
  order: 1; /* Image first */
}

.page-login__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px; /* Slightly smaller radius than container */
  object-fit: cover;
  min-height: 200px; /* Minimum image size */
}

.page-login__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 600px;
  order: 2; /* Content after image */
  color: var(--text-main);
}

.page-login__hero-content h1 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gold-color); /* Use gold for h1 to stand out */
  margin-bottom: 20px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(28px, 4vw, 48px); /* Responsive font size for H1 */
}

.page-login__hero-content p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.page-login__form-container {
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 450px;
  margin: 30px auto;
  text-align: left;
  border: 1px solid var(--border-color);
}

.page-login__form-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 30px;
  text-align: center;
}

.page-login__input-group {
  margin-bottom: 25px;
}

.page-login__input-group label {
  display: block;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.page-login__input-group input[type="text"],
.page-login__input-group input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--deep-green);
  color: var(--text-main);
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.page-login__input-group input[type="text"]:focus,
.page-login__input-group input[type="password"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(17, 168, 78, 0.3);
  outline: none;
}

.page-login__input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.page-login__cta-button {
  display: block; /* Make button full width */
  width: 100%; /* Ensure full width */
  padding: 15px 25px;
  background: var(--button-gradient);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box; /* Include padding in width */
}

.page-login__cta-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-login__form-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.page-login__link-forgot,
.page-login__register-prompt a {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-login__link-forgot:hover,
.page-login__register-prompt a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-login__register-prompt {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 20px;
}

/* General section styling */
.page-login__section {
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-login__section h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-color);
  margin-bottom: 25px;
  text-align: center;
  line-height: 1.3;
}

.page-login__section h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-login__section p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.page-login__section ul,
.page-login__section ol {
  list-style-position: inside;
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-secondary);
}

.page-login__section ul li,
.page-login__section ol li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.page-login__section ul li::marker {
  color: var(--primary-color);
}
.page-login__section ol li::marker {
  color: var(--primary-color);
  font-weight: bold;
}

.page-login__troubleshoot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.page-login__troubleshoot-item {
  background-color: var(--deep-green);
  padding: 25px;
  border-radius: 10px;
  border: 1px solid var(--divider-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-login__troubleshoot-item h3 {
  font-size: 20px;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 15px;
}

.page-login__troubleshoot-item p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.page-login__btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.page-login__btn-secondary:hover {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Image styling within sections */
.page-login__section-image {
  width: 100%;
  margin: 30px 0;
  text-align: center;
}

.page-login__section-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  min-height: 200px; /* Minimum image size */
}

/* FAQ Section */
.page-login__faq-section {
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

details.page-login__faq-item {
  margin-bottom: 15px;
  border-radius: 8px; /* Slightly larger radius for individual items */
  border: 1px solid var(--divider-color);
  overflow: hidden;
  background: var(--deep-green); /* Use deep green for FAQ items */
  color: var(--text-main);
}
details.page-login__faq-item summary.page-login__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
  color: var(--text-main);
}
details.page-login__faq-item summary.page-login__faq-question::-webkit-details-marker {
  display: none;
}
details.page-login__faq-item summary.page-login__faq-question:hover {
  background: rgba(var(--primary-color), 0.1); /* Subtle hover effect */
}
.page-login__faq-qtext {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--text-main);
}
.page-login__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color); /* Gold for toggle icon */
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-login__faq-item .page-login__faq-answer {
  padding: 0 20px 20px;
  background: rgba(var(--deep-green), 0.7); /* Slightly lighter background for answer */
  border-radius: 0 0 8px 8px;
  color: var(--text-secondary);
}
.page-login__faq-answer p {
  margin-bottom: 0;
}


/* Responsive Design */
@media (max-width: 768px) {
  .page-login {
    padding: 15px;
  }

  .page-login__hero-section {
    padding-top: 10px !important; /* Important for mobile as per instruction */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 30px;
  }
  
  .page-login__hero-image img {
    border-radius: 4px;
  }

  .page-login__hero-content h1 {
    font-size: clamp(24px, 6vw, 36px);
  }

  .page-login__hero-content p {
    font-size: 16px;
  }

  .page-login__form-container {
    padding: 30px 20px;
    margin-top: 20px;
  }

  .page-login__form-title {
    font-size: 24px;
    margin-bottom: 25px;
  }

  .page-login__input-group {
    margin-bottom: 20px;
  }

  .page-login__cta-button {
    padding: 14px 20px;
    font-size: 16px;
    max-width: 100% !important; /* Mobile button width */
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-login__form-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .page-login__link-forgot,
  .page-login__register-prompt a {
    font-size: 14px;
  }

  .page-login__section {
    padding: 30px 20px;
    margin-bottom: 25px;
  }

  .page-login__section h2 {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .page-login__section h3 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
  }

  .page-login__section p,
  .page-login__section ul li,
  .page-login__section ol li {
    font-size: 15px;
    line-height: 1.6;
  }

  .page-login__section-image img {
    border-radius: 4px;
  }

  details.page-login__faq-item summary.page-login__faq-question { padding: 15px; }
  .page-login__faq-qtext { font-size: 15px; }
  .page-login__faq-answer { padding: 0 15px 15px; }

  .page-login__troubleshoot-grid {
    grid-template-columns: 1fr;
  }

  .page-login__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 🚨 Mobile image responsive adaptation (must contain) */
  .page-login img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-login__section,
  .page-login__card,
  .page-login__container,
  .page-login__form-container,
  .page-login__faq-section,
  .page-login__troubleshoot-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}