/* ===== MODERN FORM DESIGN SYSTEM ===== */

/* Base DemoBox adjustments */
.demobox {
    margin-top: 150px;
    overflow: visible; /* Allow focus glows to breathe */
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Responsive Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Form Field Container */
.form-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0; /* Gap not needed with absolute labels */
    text-align: left;
}

/* Floating Label Base */
.form-field label {
    position: absolute;
    left: 18px;
    top: 14px;
    font-size: 16px;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    text-transform: none; /* Let's try more natural casing */
    letter-spacing: normal;
    margin: 0;
}

/* Modern Inputs Adjusted for Floating Labels */
.inputregister, 
select#reg-plan {
    width: 100%;
    padding: 24px 18px 8px; /* Extra top padding for floating label */
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', system-ui, sans-serif;
    outline: none;
    height: 60px; /* Fixed height for better consistency */
}

/* Floating State Trigger */
.inputregister:focus ~ label,
.inputregister:not(:placeholder-shown) ~ label {
    top: 8px;
    font-size: 12px;
    font-weight: 700;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64be79; /* Brand green on focus/active */
}

/* Special Case: Select doesn't support :placeholder-shown easily */
.form-field select#reg-plan ~ label {
    top: 8px;
    font-size: 12px;
    font-weight: 700;
    opacity: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field select#reg-plan:focus ~ label {
    color: #64be79;
}

/* Select Wrapper for custom arrow if needed */
.select-wrapper {
    position: relative;
    width: 100%;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.form-actions button.botonregistro {
    padding: 16px 40px;
    font-size: 18px;
    border-radius: 14px;
    width: auto;
    min-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.form-actions button.botonregistro:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.form-actions button.botonregistro:active {
    transform: translateY(0);
}

/* ===== DARK MODE: Glassmorphism ===== */
.dark .demobox {
    background: radial-gradient(circle at top left, rgba(30, 80, 70, 0.7), rgba(15, 30, 45, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark .demobox h2 {
    background: linear-gradient(135deg, #64be79 0%, #36ceff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.dark .form-field label {
    color: #a0aec0;
}

.dark .inputregister,
.dark select#reg-plan {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dark .inputregister:hover,
.dark select#reg-plan:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(100, 190, 121, 0.4);
}

.dark .inputregister:focus,
.dark select#reg-plan:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #64be79;
    box-shadow: 0 0 0 4px rgba(100, 190, 121, 0.2);
}

.dark .inputregister::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* ===== LIGHT MODE: Clean & Soft ===== */
.light .demobox,
.demobox { /* Default to light fallback */
    background: radial-gradient(circle at top left, #f0fdf4, #f8fafc) !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.light .form-field label {
    color: #4a5568;
}

.light .inputregister,
.light select#reg-plan {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1a202c;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.light .inputregister:hover,
.light select#reg-plan:hover {
    border-color: #cbd5e0;
}

.light .inputregister:focus,
.light select#reg-plan:focus {
    border-color: #64be79;
    box-shadow: 0 0 0 4px rgba(100, 190, 121, 0.1);
}

.light .inputregister::placeholder {
    color: #a0aec0;
}

/* Responsiveness adjustments */
@media (max-width: 640px) {
    .demobox {
        padding: 30px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .demobox h2 {
        font-size: 40px !important;
        white-space: normal;
    }
}

/* ===== MODAL STYLES ===== */
.modal, .modalConfirmacion {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.dark .modal, .dark .modalConfirmacion {
  background: #1a202c;
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal.active, .modalConfirmacion.show {
  display: block;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  z-index: 999;
}

.modal-overlay.show {
  display: block;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  cursor: pointer;
}

/* Plans Grid in Modal */
.plans-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 25px;
}

.modal-inner {
    text-align: center;
}

.form-grid-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.form-actions-modal {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.form-actions-modal .button {
    min-width: 180px;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dark .btn-cancel {
    border-color: rgba(255,255,255,0.1);
    color: #a0aec0;
}

.btn-cancel:hover {
    background: #fff5f5;
    color: #e53e3e;
    border-color: #feb2b2;
}

.plan-card {
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.dark .plan-card {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}

.plan-card.plan-selected {
  border-color: #64be79;
  background: rgba(100, 190, 121, 0.05);
  box-shadow: 0 0 15px rgba(100, 190, 121, 0.2);
}

.plan-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.precioplan, .precioplanselect {
  font-size: 20px;
  font-weight: 800;
  color: #64be79;
  margin-bottom: 15px;
}

.btnseleccionar {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #edf2f7;
  cursor: pointer;
  font-weight: bold;
}

.dark .btnseleccionar {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btnseleccionar:hover {
  background: #64be79;
  color: white;
}

/* ===== PREMIUM SWEETALERT STYLES ===== */
.premium-swal-popup {
    border-radius: 24px !important;
    padding: 2em !important;
    font-family: 'Inter', sans-serif !important;
}

.premium-swal-title {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #1a202c !important;
}

.dark .premium-swal-title {
    color: #ffffff !important;
}

.swal-premium-content {
    margin-top: 15px;
}

.swal-subtitle {
    font-size: 15px;
    color: #718096;
    margin-bottom: 25px;
    line-height: 1.5;
}

.swal-field-group {
    margin-bottom: 20px;
    text-align: left;
}

.swal-field-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64be79;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-left: 5px;
}

.swal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.swal-input-wrapper i {
    position: absolute;
    left: 18px;
    color: #cbd5e0;
    font-size: 16px;
}

.swal-custom-input {
    width: 100% !important;
    height: 54px !important;
    padding: 0 20px 0 48px !important;
    border-radius: 14px !important;
    border: 2px solid #edf2f7 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

.swal-custom-input:focus {
    border-color: #64be79 !important;
    box-shadow: 0 0 0 4px rgba(100, 190, 121, 0.1) !important;
    outline: none !important;
}

.swal-custom-input.readonly {
    background-color: #f7fafc !important;
    color: #a0aec0 !important;
    border-style: dashed !important;
}

.premium-swal-confirm {
    padding: 14px 30px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 14px !important;
}

.premium-swal-cancel {
    background-color: transparent !important;
    color: #718096 !important;
    font-weight: 600 !important;
    padding: 14px 20px !important;
}

.premium-swal-cancel:hover {
    color: #e53e3e !important;
}
