/**
 * Energy Basket LOA Signing Styles
 * Modern, responsive styling for the LOA signing interface
 */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

/* Container Styles */
#loa-container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
}

.loa-form-container {
  background: white;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 20px;
}

/* Typography */
h1 {
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
}

h2 {
  color: #34495e;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

.intro-text {
  font-size: 1.1rem;
  color: #7f8c8d;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.8;
}

/* Form Styles */
.confirmation-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-section {
  background: #f8f9fa;
  padding: 18px;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group input {
  padding: 10px 14px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:required:invalid {
  border-color: #e74c3c;
}

.form-group input[readonly] {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  border-color: #dee2e6;
}

.form-group input[readonly]:focus {
  border-color: #dee2e6;
  box-shadow: none;
}

.info-note {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.info-note p {
  color: #856404;
  font-size: 0.9rem;
  margin: 0;
}

/* Alternative User Info Styles */
.alternative-user-info {
  background: #d1f2eb !important;
  border: 1px solid #a7f3d0 !important;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
}

.alternative-user-message {
  color: #065f46;
}

.alternative-user-message h4 {
  color: #065f46;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alternative-user-message p {
  color: #047857;
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

.alternative-user-message p:last-child {
  margin-bottom: 0;
}

/* Meter Selection Styles */
.meters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 5px 0;
}



.meter-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.meter-checkbox input[type="checkbox"] {
  margin-right: 15px;
  transform: scale(1.2);
  cursor: pointer;
}

.meter-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.meter-identifier {
  font-weight: 700;
  color: #2c3e50;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.meter-site {
  color: #7f8c8d;
  font-size: 0.9rem;
  font-style: italic;
}

.no-meters {
  text-align: center;
  color: #95a5a6;
  font-style: italic;
  padding: 20px;
}

/* Button Styles */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.btn-link {
  background: none;
  color: #3498db;
  border: none;
  padding: 8px 12px;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.btn-link:hover {
  color: #2980b9;
  background: rgba(52, 152, 219, 0.1);
  text-decoration: none;
  border-radius: 4px;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #2ecc71;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn-success:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.btn-save {
  font-size: 0.9rem;
  padding: 10px 20px;
  margin-right: 10px;
}

.save-section {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #27ae60;
  display: flex;
  align-items: center;
  gap: 15px;
}

.save-status {
  font-size: 0.9rem;
  font-weight: 600;
}

.save-status.success {
  color: #27ae60;
}

.save-status.error {
  color: #e74c3c;
}

.save-status.saving {
  color: #f39c12;
}

/* Alternative Contact Fields */
.alternative-contact-fields {
  background: #e8f4fd;
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Meter Grouping Styles */
.meter-group {
  margin-bottom: 18px;
}

.meter-group-title {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.meter-group-title::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  margin-right: 8px;
}

.meter-group-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 5px;
}

/* Enhanced Meter Item Styles */
.meter-item {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 12px;
  transition: all 0.3s ease;
  position: relative;
}

.meter-item:hover {
  border-color: #3498db;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
  transform: translateY(-1px);
}

.meter-item:has(input:checked) {
  border-color: #27ae60;
  background: #f8fff9;
}

/* Meter Contact Information */
.meter-contact-info {
  background: #e8f4fd;
  border: 1px solid #bde0ff;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
  text-align: center;
}

.meter-contact-info p {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.contact-details {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-item {
  color: #34495e;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-item a {
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: #2980b9;
  text-decoration: underline;
}



/* Thank You Message */
.contact-thank-you {
  margin-top: 20px;
  padding: 30px;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  animation: fadeIn 0.5s ease-in;
  text-align: center;
}

.thank-you-message h3 {
  color: #155724;
  font-size: 1.4rem;
  margin-bottom: 20px;
  text-align: center;
}

.thank-you-message p {
  color: #155724;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: center;
}

.thank-you-message p:last-child {
  margin-bottom: 0;
  font-weight: 600;
}

/* Opt-out Information Styling */
.opt-out-info, .non-renewal-info {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  margin: 20px auto;
  text-align: left;
  max-width: 600px;
}

.opt-out-info h4 {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.opt-out-info ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

.opt-out-info li {
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.opt-out-info li:last-child {
  margin-bottom: 0;
}

/* Opt-out info in error messages */
.error-message .opt-out-info {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
}

.error-message .opt-out-info h4 {
  color: #856404;
}

.error-message .opt-out-info li {
  color: #856404;
}

/* Confirmation Screen Styles */
.confirmation-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 8px;
  border-left: 4px solid #f39c12;
  margin: 20px 0;
  text-align: center;
}

.confirmation-section h2 {
  color: #e67e22;
  font-size: 1.5rem;
  margin-bottom: 15px;
  border-bottom: none;
  padding-bottom: 0;
}

.confirmation-section p {
  color: #495057;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.confirmation-actions {
  margin-top: 30px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Contact Error Message */
.contact-error {
  margin-top: 20px;
  padding: 30px;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
  border-radius: 8px;
  animation: fadeIn 0.5s ease-in;
  text-align: center;
}

.error-message h3 {
  color: #721c24;
  font-size: 1.4rem;
  margin-bottom: 20px;
  text-align: center;
}

.error-message p {
  color: #721c24;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: center;
}

.error-message .contact-details {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
}

.error-message .contact-details p {
  color: #856404;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.error-message .contact-details a {
  color: #3498db;
  text-decoration: none;
  font-weight: 700;
}

.error-message .contact-details a:hover {
  text-decoration: underline;
}

.error-reference {
  font-size: 0.85rem !important;
  color: #6c757d !important;
  font-style: italic;
  margin-top: 15px;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 4px;
}

/* Custom Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: center;
}

.modal-content p {
  color: #7f8c8d;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 25px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 100px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid #e1e8ed;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.loading-content {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e1e8ed;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading-message {
  font-size: 1.1rem;
  color: #7f8c8d;
  font-weight: 500;
  margin: 0;
}

/* SignNow Container */
.signnow-container {
  background: white;
  border-radius: 12px;
  padding: 0;
}

.signnow-container h2 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 20px;
}

#signnow-iframe {
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  width: 100%;
  min-height: 600px;
}

/* Error and Success Containers */
.error-container, .success-container {
  background: white;
  border-radius: 12px;
  padding: 0;
  text-align: center;
}

.error-container h1 {
  color: #e74c3c;
  margin-bottom: 20px;
}

.success-container h1 {
  color: #27ae60;
  margin-bottom: 20px;
}

.error-message {
  color: #7f8c8d;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.help-text {
  color: #95a5a6;
  font-size: 0.9rem;
  margin-top: 15px;
  font-style: italic;
}

.success-message {
  color: #7f8c8d;
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  #loa-container {
    padding: 0;
  }

  .loa-form-container {
    padding: 0;
  }

  h1 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .meter-details {
    gap: 2px;
  }

  .loading-content {
    padding: 30px 20px;
    margin: 0 15px;
  }

  .modal-content {
    margin: 0 15px;
    padding: 25px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .intro-text {
    font-size: 1rem;
  }

  .form-section {
    padding: 20px;
  }

  .meter-checkbox {
    flex-direction: column;
    align-items: flex-start;
  }

  .meter-checkbox input[type="checkbox"] {
    margin-bottom: 10px;
    margin-right: 0;
  }

  .meter-group-title {
    font-size: 1rem;
    padding: 8px 12px;
  }

  .contact-details {
    flex-direction: column;
    gap: 15px;
  }

  .btn-update-contact {
    width: 100%;
    font-size: 0.9rem;
  }

  .contact-thank-you {
    padding: 15px;
  }

  .thank-you-message h3 {
    font-size: 1.1rem;
  }

  .thank-you-message p {
    font-size: 0.9rem;
  }
}

/* Agreements Section Styles */
.agreements-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agreement-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  transition: border-color 0.3s ease;
}

.agreement-item:hover {
  border-color: #3498db;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #3498db;
}

.checkbox-text {
  flex: 1;
  font-size: 0.9rem;
  color: #2c3e50;
}

.checkbox-text strong {
  color: #2c3e50;
  font-weight: 600;
}

.agreement-text {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
  margin-top: 4px;
  display: block;
}

.agreement-text a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.agreement-text a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Validation styling for required checkboxes */
.checkbox-label input[type="checkbox"]:invalid {
  outline: 2px solid #e74c3c;
  outline-offset: 2px;
}

.checkbox-label input[type="checkbox"]:invalid + .checkbox-text {
  color: #e74c3c;
}

/* Mobile responsiveness for agreements */
@media (max-width: 768px) {
  .checkbox-text {
    font-size: 0.85rem;
  }
  
  .agreement-text {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .agreement-item {
    padding: 12px;
  }
  
  .checkbox-label {
    gap: 10px;
  }
  
  .checkbox-text {
    font-size: 0.8rem;
  }
  
  .agreement-text {
    font-size: 0.75rem;
  }
}