/* ========================================
   Tutore Login Theme - Custom CSS
   Based on Figma design specifications
======================================== */

/* CSS Variables for Tutore Brand Colors */
:root {
  --tutore-primary: #ea580c; /* Orange-600 */
  --tutore-primary-hover: #dc2626; /* Red-600 */
  --tutore-primary-light: #fed7aa; /* Orange-200 */
  --tutore-text-primary: #0f172a; /* Slate-950 */
  --tutore-text-secondary: #64748b; /* Slate-500 */
  --tutore-text-muted: #94a3b8; /* Slate-400 */
  --tutore-background: #ffffff; /* White */
  --tutore-surface: #f8fafc; /* Slate-50 */
  --tutore-border: #e2e8f0; /* Slate-200 */
  --tutore-border-focus: #cbd5e1; /* Slate-300 */
  --tutore-error: #ef4444; /* Red-500 */
  --tutore-success: #22c55e; /* Green-500 */
  --tutore-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
  --tutore-shadow-lg: 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
  --tutore-border-radius: 8px;
  --tutore-border-radius-full: 9999px;
}

/* ========================================
   Base Layout & Typography
======================================== */

.tutore-theme {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Roboto',
    sans-serif;
}

.tutore-login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutore-login-container {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-sizing: border-box;
  min-height: 100vh;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

/* ========================================
   Left Panel - Login Form
======================================== */

.tutore-content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  width: 100%;
  background: #ffffff;
}

.tutore-form-card {
  background: var(--tutore-background);
  max-width: 420px;
  width: 100%;
  padding: 0;
  box-shadow: none;
  border: none;
}

.tutore-header {
  margin-bottom: 0;
  text-align: left;
}

.tutore-logo {
  width: 39.6px; /* +10% */
  height: 17.6px; /* +10% */
  margin-bottom: 24px;
  align-self: flex-start;
  display: inline-flex;
}

.tutore-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tutore-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  color: var(--tutore-text-primary);
  margin-top: 0;
  margin-bottom: 12px;
  text-align: left;
}

.tutore-subtitle {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--tutore-text-secondary);
  text-align: left;
}

/* ========================================
   Domain Change Alert Banner
======================================== */

.tutore-domain-alert {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 12px 16px;
  box-sizing: border-box;
  background: #fff7ed;
  border: 1px solid var(--tutore-primary);
  border-radius: 12px;
  overflow: hidden;
}

.tutore-domain-alert-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--tutore-primary);
}

.tutore-domain-alert-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.tutore-domain-alert-text {
  flex: 1 1 0;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--tutore-primary);
  word-break: break-word;
}

.tutore-domain-alert-text strong {
  font-weight: 700;
}

/* ========================================
   Form Elements
======================================== */

.tutore-form {
  margin-top: 24px;
  margin-bottom: 24px;
}

.tutore-form-group {
  margin-bottom: 18px;
  position: relative;
}

.tutore-form-group-password {
  position: relative;
}

.tutore-form-group-password .tutore-input-group {
  position: relative;
}

.tutore-forgot-password-link {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 14px;
  z-index: 10;
  text-decoration: underline;
  color: #64748b;
  transition: color 0.2s ease;
}

.tutore-forgot-password-link:hover {
  color: #ea580c;
}

.tutore-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--tutore-text-primary);
  margin-bottom: 10px;
  width: auto;
  max-width: 100%;
  white-space: normal;
}

.tutore-input-wrapper {
  position: relative;
}

.tutore-input {
  width: 100%;
  height: 36px;
  padding: 4px 12px 4px 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 400;
  color: var(--tutore-text-primary);
  transition: all 0.2s ease;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
}

.tutore-input:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.tutore-input::placeholder {
  color: #64748b;
}

.tutore-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.tutore-input-group .tutore-input {
  padding-left: 12px;
  padding-right: 12px;
}

.tutore-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* input icons removed by request */

.tutore-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tutore-text-muted);
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
  z-index: 20; /* above .tutore-forgot-password-link (z-index:10) */
}

.tutore-password-toggle:hover {
  color: var(--tutore-text-primary);
}

.tutore-input-error-message {
  font-size: 12px;
  color: var(--tutore-error);
  margin-top: 4px;
  display: block;
}

.tutore-field-error {
  margin-top: 6px;
  margin-bottom: 4px;
}

.tutore-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.tutore-link {
  color: var(--tutore-primary);
  text-decoration: underline;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.tutore-link:hover {
  color: var(--tutore-primary-hover);
}

/* Buttons layout inside forms (stacked with spacing like in login) */
.tutore-form-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

/* =======================
   Modal (Tutore style)
   ======================= */
.tutore-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.tutore-modal.open {
  display: flex;
}
.tutore-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.tutore-modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: calc(100% - 32px);
  max-width: 640px;
  box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.tutore-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.tutore-modal-body {
  padding: 16px 20px;
  max-height: 60vh;
  overflow: auto;
}
.tutore-modal-footer {
  padding: 12px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
}
.tutore-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.tutore-modal-close:hover {
  color: #0f172a;
}
.tutore-link-strong {
  font-weight: 600;
}

/* Password requirements hint */
.tutore-password-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--tutore-text-muted);
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--tutore-surface);
  border-radius: 8px;
  border: 1px solid var(--tutore-border);
}

.tutore-password-hint::before {
  content: 'ℹ';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  background: var(--tutore-primary);
  border-radius: 50%;
}

/* Terms and Privacy checkbox container */
.tutore-terms-group {
  margin-top: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

/* Checkbox highlight animation when user tries to submit without accepting */
.tutore-checkbox-highlight {
  animation: tutore-shake 0.5s ease-in-out;
}

.tutore-checkbox-highlight input[type='checkbox'] {
  border-color: var(--tutore-error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
  animation: tutore-pulse 0.3s ease-in-out 2;
}

@keyframes tutore-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

@keyframes tutore-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* ========================================
   Buttons
======================================== */

.tutore-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--tutore-border-radius-full);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.tutore-button-primary {
  background: #ea580c;
  color: #f8fafc;
  width: 100%;
  margin-top: 8px;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
}

.tutore-button-primary:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Disabled buttons */
.tutore-button[disabled],
.tutore-button:disabled,
.tutore-button-primary[disabled],
.tutore-button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}
.tutore-button-primary[disabled],
.tutore-button-primary:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  transform: none;
}
.tutore-button-primary[disabled]:hover,
.tutore-button-primary:disabled:hover {
  background: #e2e8f0;
  transform: none;
  box-shadow: none;
}

/* Secondary/Cancel button */
.tutore-button-default {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  width: 100%;
  border-radius: 9999px;
  padding: 8px 16px;
}

.tutore-social-button {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
}

.tutore-social-button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ========================================
   Social Icons
======================================== */

.tutore-social-icon {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.tutore-social-icon.google {
  background-image: url('../img/google-icon.svg');
}

.tutore-social-button .tutore-social-icon {
  margin-right: 8px;
}

/* Align social list to single icon button like in design */
.tutore-social-section {
  margin-top: 0;
}

.tutore-social-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tutore-social-provider-item {
  width: 100%;
}

/* Button reduced to icon only when provider supplies icon classes */
.tutore-social-button {
  height: 36px;
}

.tutore-social-name {
  display: none;
}

.tutore-social-button:hover .tutore-social-icon.google {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* ========================================
   Separator
======================================== */

.tutore-separator {
  width: 100%;
  position: relative;
  margin: 10px 0;
}

.tutore-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e2e8f0;
}

.tutore-separator::after {
  content: 'LUB';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  line-height: 16px;
}

/* ========================================
   Right Panel - Image
======================================== */

.tutore-hero-panel {
  background: url('../img/login-hero.png') no-repeat center;
  background-size: cover;
  border-radius: 14px;
  min-height: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  padding: 0;
}

/* Centered white brand mark overlay like in Figma */
/* Removed centered logo overlay as requested */

/* ========================================
   Additional Login Methods
======================================== */

.tutore-additional-login {
  margin-top: 24px;
  text-align: center;
}

.tutore-otp-link-wrapper {
  margin-top: 16px;
}

.tutore-otp-link {
  color: #ea580c !important;
  text-decoration: underline !important;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.tutore-otp-link:hover {
  color: #dc2626 !important;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 1024px) {
  .tutore-login-container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 0;
    min-height: 100vh;
  }

  .tutore-hero-panel {
    display: none;
  }

  .tutore-content-wrapper {
    padding: 0;
    justify-content: center;
    max-width: 100%;
    flex: 1;
  }

  .tutore-form-card {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .tutore-login-container {
    padding: 16px;
    min-height: 100vh;
  }

  .tutore-content-wrapper {
    padding: 0;
  }

  .tutore-form-card {
    max-width: 100%;
  }

  .tutore-title {
    font-size: 24px;
    line-height: 30px;
  }

  .tutore-subtitle {
    font-size: 13px;
    line-height: 18px;
  }
}

/* ========================================
   Language Picker
======================================== */

.tutore-locale-bar {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.tutore-locale {
  position: relative;
}

.tutore-locale-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 8px 12px;
  background: var(--tutore-background);
  border: 1px solid var(--tutore-border);
  border-radius: var(--tutore-border-radius);
  box-shadow: var(--tutore-shadow);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--tutore-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutore-locale-trigger:hover {
  background: var(--tutore-surface);
}

.tutore-locale-trigger:focus-visible {
  outline: none;
  border-color: var(--tutore-primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.tutore-locale-code {
  font-weight: 500;
}

.tutore-locale-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.tutore-locale[data-open='true'] .tutore-locale-chevron {
  transform: rotate(180deg);
}

.tutore-locale-flag {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tutore-locale-flag-pl {
  background: linear-gradient(to bottom, #ffffff 50%, #dc143c 50%);
}

.tutore-locale-flag-en {
  background: url('../img/flag-en.svg') center / cover no-repeat;
}

.tutore-locale-flag-es {
  background: linear-gradient(
    to bottom,
    #aa151b 25%,
    #f1bf00 25%,
    #f1bf00 75%,
    #aa151b 75%
  );
}

.tutore-locale-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 168px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background-color: #ffffff;
  border: 1px solid var(--tutore-border);
  border-radius: var(--tutore-border-radius);
  box-shadow: var(--tutore-shadow-lg);
}

.tutore-locale-list li {
  background-color: #ffffff;
}

.tutore-locale-list[hidden] {
  display: none;
}

.tutore-locale-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  color: var(--tutore-text-secondary);
  text-decoration: none;
  transition: background 0.2s ease;
}

.tutore-locale-item:hover {
  background: var(--tutore-surface);
}

.tutore-locale-item[aria-selected='true'] {
  color: var(--tutore-text-primary);
  font-weight: 500;
}

/* ========================================
   Utility Classes
======================================== */

.tutore-form-group-error .tutore-input {
  border-color: var(--tutore-error);
}

.tutore-form-group-error .tutore-label {
  color: var(--tutore-error);
}

.tutore-hidden {
  display: none !important;
}

.tutore-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Inline checkbox layout for compact T&C */
.tutore-checkbox-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 20px;
  color: var(--tutore-text-primary);
  cursor: pointer;
}

.tutore-checkbox-inline span {
  flex: 1;
}

.tutore-checkbox-inline a {
  color: var(--tutore-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.tutore-checkbox-inline a:hover {
  color: var(--tutore-primary-hover);
}

.tutore-checkbox-inline a strong {
  font-weight: 600;
}

.tutore-checkbox-inline a u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tutore-checkbox-inline input[type='checkbox'],
.tutore-form-options input[type='checkbox'] {
  margin: 0;
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Ensure native accent color doesn't override custom drawing */
.tutore-login-container input[type='checkbox'] {
  accent-color: initial;
}

.tutore-checkbox-inline input[type='checkbox']:hover,
.tutore-form-options input[type='checkbox']:hover {
  border-color: #cbd5e1;
}

.tutore-checkbox-inline input[type='checkbox']:focus-visible,
.tutore-form-options input[type='checkbox']:focus-visible {
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
  border-color: var(--tutore-primary);
}

.tutore-checkbox-inline input[type='checkbox']:checked,
.tutore-form-options input[type='checkbox']:checked {
  background: var(--tutore-primary);
  border-color: var(--tutore-primary);
}

.tutore-checkbox-inline input[type='checkbox']:checked::after,
.tutore-form-options input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(50% - 1px); /* lift tick by 1px */
  width: 8px;
  height: 5px;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* Align checkbox and text vertically */
.tutore-login-container
  label:has(> input[type='checkbox']):not(.tutore-checkbox-inline) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 18px;
  font-size: 14px; /* 2px smaller than base body */
}

.tutore-form-options input[type='checkbox'] {
  margin-right: 4px;
}

/* ========================================
   Icons
======================================== */

.tutore-icon-error::before {
  content: '⚠';
}
.tutore-icon-warning::before {
  content: '⚠';
}
.tutore-icon-success::before {
  content: '✓';
}
.tutore-icon-info::before {
  content: 'ℹ';
}
.tutore-icon-eye::before {
  content: '👁';
}
.tutore-icon-eye-slash::before {
  content: '🙈';
}

/* ========================================
   Animations
======================================== */

/* Force normal style and remove emoji pseudo-elements inside password toggle */
.tutore-password-toggle i,
.tutore-password-toggle [data-icon] {
  font-style: normal !important;
}
.tutore-password-toggle i::before,
.tutore-password-toggle [data-icon]::before {
  content: none !important;
}

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

.tutore-fade-in {
  animation: tutore-fade-in 0.3s ease-out;
}
