/* TaakDev - Estilos Públicos - Mobile First */

/* Base styles - Mobile */
.taakdev-container {
  margin: 10px;
  padding: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.taakdev-public {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.taakdev-header {
  border-bottom: 2px solid #0073aa;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.taakdev-header h1 {
  margin: 0 0 10px 0;
  color: #23282d;
  font-size: 1.5em;
}

.taakdev-date {
  color: #666;
  margin: 0;
}

.taakdev-content {
  padding: 20px 0;
}

.taakdev-message {
  background: #f0f6fc;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #0073aa;
}

.taakdev-message p {
  margin: 8px 0;
  font-size: 14px;
}

.taakdev-items {
  margin-top: 25px;
}

.taakdev-items h2 {
  color: #23282d;
  font-size: 1.3em;
  margin-bottom: 12px;
}

.taakdev-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.taakdev-list-item {
  background: #f9f9f9;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  border-left: 3px solid #0073aa;
  transition: all 0.3s ease;
}

.taakdev-list-item:hover {
  background: #f0f6fc;
  transform: translateX(3px);
}

.taakdev-list-item h3 {
  margin: 0 0 8px 0;
  color: #0073aa;
  font-size: 1.1em;
}

.taakdev-list-item p {
  margin: 4px 0;
  color: #666;
  font-size: 14px;
}

.taakdev-list-item small {
  color: #999;
  font-size: 0.85em;
}

.taakdev-user-info {
  background: #fffbf0;
  padding: 12px;
  border-radius: 6px;
  margin-top: 20px;
  border-left: 4px solid #f0b849;
}

.taakdev-footer {
  margin-top: 25px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* Modal Styles - Mobile First */
.taakdev-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  /* Ocultar inicialmente para evitar flash */
}

.taakdev-modal.taakdev-modal-visible {
  display: block;
  /* Mostrar cuando Alpine.js lo indique */
}

.taakdev-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.8;
}

.taakdev-modal-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  color: #fff;
  padding: 50px 20px 20px;
  box-shadow: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
}

.taakdev-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-shrink: 0;
  /* Prevent header from shrinking */
}

.taakdev-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.2s;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.taakdev-modal-close:hover {
  opacity: 0.7;
  background-color: rgba(255, 255, 255, 0.1);
}

.taakdev-modal-back {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.2s;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.taakdev-modal-back:hover {
  opacity: 0.7;
  background-color: rgba(255, 255, 255, 0.1);
}

.taakdev-form-title {
  color: #fff;
  margin-bottom: 25px;
  font-weight: 600;
  line-height: 1.3;
  font-size: 24px;
}

.taakdev-form-subtitle {
  color: #aaa;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.taakdev-modal-form {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Allow flex item to shrink */
}

/* Form Steps */
.taakdev-form-step {
  display: none;
}

.taakdev-form-step-active {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 0 20px 0;
}

/* Form Fields */
.taakdev-form-field {
  position: relative;
  margin-bottom: 18px;
}

.taakdev-form-field label {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.taakdev-form-field input,
.taakdev-form-field select {
  width: 100%;
  padding: 14px;
  background-color: transparent;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.taakdev-form-field input::placeholder {
  color: #888;
}

.taakdev-form-field input:focus,
.taakdev-form-field select:focus {
  outline: none;
  border-color: #6366f1;
}

.input-error {
  border-color: #ef4444 !important;
}

.input-error {
  border-color: #ef4444 !important;
}

.taakdev-error-message {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

/* Phone Field */
.taakdev-phone-field {
  display: block;
  margin-bottom: 18px;
}

.taakdev-phone-input-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.taakdev-phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px;
  background-color: transparent;
  border: 1px solid #444;
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: #fff;
  white-space: nowrap;
  min-width: 80px;
  justify-content: center;
}

.taakdev-flag {
  font-size: 18px;
}

.taakdev-phone-field input {
  flex: 1;
  border-radius: 0 8px 8px 0;
  border-left: none;
}

/* Form Row */
.taakdev-form-row {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Disclaimer */
.taakdev-form-disclaimer {
  color: #888;
  font-size: 12px;
  line-height: 1.5;
  margin: 18px 0;
}

/* Primary Button */
.taakdev-btn-primary {
  width: 100%;
  padding: 14px;
  background-color: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: auto;
  flex-shrink: 0;
}

.taakdev-btn-primary:hover {
  background-color: #5558e3;
}

/* External input and button */
.taakdev-external-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.taakdev-external-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}

.taakdev-external-button {
  background: #401ED5;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
}

.taakdev-external-button:hover {
  background: #3419b0;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(64, 30, 213, 0.3);
}

.taakdev-external-button:active {
  background: #2d1595;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(64, 30, 213, 0.2);
}

.taakdev-external-button:focus {
  outline: none;
  background: #2d1595;
  box-shadow: 0 0 0 3px rgba(64, 30, 213, 0.4);
}

.taakdev-external-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

#register_title_form {
  font-family: "Roboto", Sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  color: #FFFFFF;
}

/* Notifications */
.taakdev-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 10001;
  min-width: 300px;
  max-width: 500px;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
}

.taakdev-notification-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.taakdev-notification-content {
  display: flex;
  align-items: center;
  padding: 14px;
  gap: 10px;
}

.taakdev-notification-success {
  background-color: #10b981;
  color: #fff;
}

.taakdev-notification-error {
  background-color: #ef4444;
  color: #fff;
}

.taakdev-notification-icon {
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.taakdev-notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  background-color: #333;
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-weak .password-strength-fill {
  background-color: #ef4444;
  width: 33%;
}

.password-strength-fair .password-strength-fill {
  background-color: #f59e0b;
  width: 66%;
}

.password-strength-good .password-strength-fill {
  background-color: #3b82f6;
  width: 100%;
}

.password-strength-strong .password-strength-fill {
  background-color: #10b981;
  width: 100%;
}

.password-strength-text {
  font-size: 12px;
  font-weight: 500;
  color: #888;
  min-width: 45px;
  text-align: right;
}

.password-strength-weak .password-strength-text {
  color: #ef4444;
}

.password-strength-fair .password-strength-text {
  color: #f59e0b;
}

.password-strength-good .password-strength-text {
  color: #3b82f6;
}

.password-strength-strong .password-strength-text {
  color: #10b981;
}

/* Password Checklist */
.password-checklist {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.password-checklist.show {
  opacity: 1;
  max-height: 200px;
}

.password-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
  transition: all 0.2s ease;
}

.password-checklist-icon {
  font-size: 14px;
  font-weight: bold;
  min-width: 16px;
  transition: all 0.2s ease;
}

.password-checklist-item.valid {
  color: #10b981;
}

.password-checklist-item.valid .password-checklist-icon {
  color: #10b981;
  content: "✓";
}

.password-checklist-item.invalid .password-checklist-icon {
  color: #ef4444;
  content: "✗";
}

.password-checklist-text {
  flex: 1;
}

/* Tablet Styles */
@media (min-width: 768px) {
  .taakdev-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
  }

  .taakdev-header h1 {
    font-size: 2em;
  }

  .taakdev-message {
    padding: 20px;
  }

  .taakdev-message p {
    margin: 10px 0;
    font-size: 16px;
  }

  .taakdev-items h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
  }

  .taakdev-list-item {
    padding: 15px;
    margin-bottom: 10px;
  }

  .taakdev-list-item:hover {
    transform: translateX(5px);
  }

  .taakdev-list-item h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
  }

  .taakdev-list-item p {
    margin: 5px 0;
  }

  .taakdev-list-item small {
    font-size: 0.9em;
  }

  .taakdev-user-info {
    padding: 15px;
  }

  .taakdev-footer {
    margin-top: 30px;
    padding-top: 15px;
    font-size: 16px;
  }

  /* Modal - Tablet */
  .taakdev-modal-content {
    top: 0;
    right: 0;
    left: auto;
    width: 100%;
    max-width: 500px;
    padding: 60px 30px 30px;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
  }

  .taakdev-modal-header {
    margin-bottom: 40px;
    flex-shrink: 0;
  }

  .taakdev-form-title {
    font-size: 28px;
  }

  .taakdev-form-subtitle {
    font-size: 15px;
  }

  .taakdev-form-field {
    margin-bottom: 20px;
  }

  .taakdev-form-field input,
  .taakdev-form-field select {
    padding: 16px;
  }

  .taakdev-phone-prefix {
    padding: 16px;
  }

  .taakdev-phone-field input {
    padding: 16px;
  }

  .taakdev-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .taakdev-form-disclaimer {
    font-size: 13px;
    margin: 20px 0;
  }

  .taakdev-btn-primary {
    padding: 16px;
    margin-top: 0;
    flex-shrink: 0;
  }

  .taakdev-external-container {
    flex-direction: row;
    align-items: center;
  }

  .taakdev-external-input {
    min-width: 250px !important;
    max-width: 300px !important;
    flex: 1;
  }

  .taakdev-external-button {
    flex-shrink: 0;
  }

  #register_title_form {
    font-size: 46px;
    letter-spacing: -1.3px;
  }

  /* Notifications - Tablet */
  .taakdev-notification {
    min-width: 350px;
    max-width: 600px;
  }

  .taakdev-notification-content {
    padding: 16px;
    gap: 12px;
  }

  .taakdev-notification-icon {
    font-size: 20px;
  }

  .taakdev-notification-message {
    font-size: 15px;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .taakdev-modal-content {
    max-width: 600px;
    padding: 60px 40px 40px;
  }

  .taakdev-modal-header {
    margin-bottom: 50px;
    flex-shrink: 0;
  }

  .taakdev-form-title {
    font-size: 32px;
  }

  .taakdev-form-field input,
  .taakdev-form-field select {
    font-size: 17px;
  }

  .taakdev-phone-prefix {
    padding: 16px 20px;
  }

  .taakdev-notification {
    max-width: 700px;
  }
}

/* Large Desktop Styles */
@media (min-width: 1440px) {
  .taakdev-container {
    max-width: 1400px;
  }

  .taakdev-modal-content {
    max-width: 700px;
  }
}

/* Additional mobile optimizations */
@media (max-width: 767px) {

  /* Prevent zoom on input focus on iOS */
  .taakdev-form-field input,
  .taakdev-form-field select {
    font-size: 16px !important;
  }

  /* Better touch targets */
  .taakdev-modal-close,
  .taakdev-modal-back {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Ensure modal takes full viewport height */
  .taakdev-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
  }
}

/* Success Screen */
.taakdev-success-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: transparent;
}

.taakdev-success-header {
  display: flex;
  justify-content: flex-end;
  padding: 20px 20px 0 20px;
  flex-shrink: 0;
}

.taakdev-success-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.taakdev-success-icon {
  font-size: 80px;
  color: #10b981;
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #10b981;
}

.taakdev-success-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #fff;
}

.taakdev-success-message {
  font-size: 26px;
  line-height: 1.6;
  margin-bottom: 24px;
  color: #ccc;
}

.taakdev-success-details {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: left;
  width: 100%;
}

.taakdev-success-details p {
  margin: 0 0 12px 0;
  font-weight: 600;
  color: #fff;
}

.taakdev-success-details ul {
  margin: 0;
  padding-left: 20px;
}

.taakdev-success-details li {
  margin-bottom: 8px;
  color: #ccc;
  line-height: 1.5;
}

.taakdev-btn-success {
  background-color: #401ED5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 200px;
}

.taakdev-btn-success:hover {
  background-color: #401ED5;
}

/* Responsive Success Screen */
@media (min-width: 768px) {
  .taakdev-success-header {
    padding: 30px 30px 0 30px;
  }

  .taakdev-success-content {
    padding: 30px;
  }

  .taakdev-success-icon {
    font-size: 100px;
    width: 140px;
    height: 140px;
  }

  .taakdev-success-title {
    font-size: 32px;
  }

  .taakdev-success-message {
    font-size: 26px;
  }

  .taakdev-success-details {
    padding: 24px;
  }

  .taakdev-btn-success {
    padding: 18px 40px;
    font-size: 18px;
  }
}
