/* Flymark Identity Pages - Modern Design System */

:root {
  /* Design Tokens */
  --flm-primary: #3eb5f1;
  --flm-primary-hover: #2ea3d9;
  --flm-primary-light: rgba(62, 181, 241, 0.1);

  --flm-text-primary: #2c3e50;
  --flm-text-secondary: #6c757d;
  --flm-text-muted: #adb5bd;

  --flm-background: #ffffff;
  --flm-background-light: #f8f9fa;
  --flm-border: #dee2e6;
  --flm-border-light: #e9ecef;

  --flm-success: #28a745;
  --flm-danger: #dc3545;

  --flm-space-xs: 4px;
  --flm-space-sm: 8px;
  --flm-space-md: 16px;
  --flm-space-lg: 24px;
  --flm-space-xl: 32px;
  --flm-space-xxl: 48px;

  --flm-radius-sm: 4px;
  --flm-radius-md: 8px;
  --flm-radius-lg: 12px;
  --flm-radius-xl: 16px;

  --flm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --flm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --flm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --flm-transition-fast: 150ms ease-in-out;
}

/* Reset for identity pages */
.identity-page *,
.identity-page *::before,
.identity-page *::after {
  box-sizing: border-box;
}

/* ============================================================================
   Base Layout
   ============================================================================ */

.identity-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--flm-background-light) 0%, #e9ecef 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--flm-text-primary);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.identity-header {
  padding: var(--flm-space-lg);
  text-align: center;
}

.identity-logo {
  height: 48px;
  width: auto;
  transition: var(--flm-transition-fast);
}

.identity-logo:hover {
  opacity: 0.8;
}

.identity-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--flm-space-lg);
}

.identity-card {
  width: 100%;
  max-width: 440px;
  background: var(--flm-background);
  border-radius: var(--flm-radius-xl);
  box-shadow: var(--flm-shadow-lg);
  padding: var(--flm-space-xl);
}

.identity-card-wide {
  max-width: 540px;
}

.identity-footer {
  padding: var(--flm-space-lg);
  text-align: center;
  color: var(--flm-text-muted);
  font-size: 14px;
}

.identity-footer a {
  color: var(--flm-text-muted);
  text-decoration: none;
}

.identity-footer a:hover {
  color: var(--flm-primary);
}

/* ============================================================================
   Typography
   ============================================================================ */

.identity-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--flm-text-primary);
  margin: 0 0 var(--flm-space-lg) 0;
  text-align: center;
}

.identity-subtitle {
  font-size: 14px;
  color: var(--flm-text-secondary);
  text-align: center;
  margin: calc(var(--flm-space-sm) * -1) 0 var(--flm-space-lg) 0;
}

.identity-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--flm-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--flm-space-md) 0;
}

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

.identity-form {
  margin: 0;
  padding: 0;
}

.identity-form-group {
  margin-bottom: var(--flm-space-md);
}

.identity-form-row {
  display: flex;
  gap: var(--flm-space-md);
}

.identity-form-row .identity-form-group {
  flex: 1;
}

.identity-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--flm-text-secondary);
  margin-bottom: var(--flm-space-xs);
}

.identity-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--flm-border);
  border-radius: var(--flm-radius-md);
  background: var(--flm-background);
  color: var(--flm-text-primary);
  transition: var(--flm-transition-fast);
}

.identity-input:focus {
  outline: none;
  border-color: var(--flm-primary);
  box-shadow: 0 0 0 3px var(--flm-primary-light);
}

.identity-input::placeholder {
  color: var(--flm-text-muted);
}

.identity-input:disabled {
  background: var(--flm-background-light);
  color: var(--flm-text-muted);
  cursor: not-allowed;
}

.identity-input.input-validation-error {
  border-color: var(--flm-danger);
}

.identity-input.input-validation-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

.identity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--flm-space-sm);
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--flm-primary);
  border: none;
  border-radius: var(--flm-radius-lg);
  cursor: pointer;
  transition: var(--flm-transition-fast);
  text-decoration: none;
}

.identity-btn:hover {
  background: var(--flm-primary-hover);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.identity-btn:active {
  transform: translateY(0);
}

.identity-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.identity-btn-secondary {
  background: var(--flm-background);
  color: var(--flm-text-primary);
  border: 1px solid var(--flm-border);
}

.identity-btn-secondary:hover {
  background: var(--flm-background-light);
  border-color: var(--flm-primary);
  color: var(--flm-primary);
}

.identity-btn-sm {
  padding: 10px 16px;
  font-size: 14px;
}

/* ============================================================================
   Social Login
   ============================================================================ */

.identity-divider {
  display: flex;
  align-items: center;
  gap: var(--flm-space-md);
  margin: var(--flm-space-lg) 0;
  color: var(--flm-text-muted);
  font-size: 14px;
}

.identity-divider::before,
.identity-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--flm-border);
}

.identity-social-buttons {
  display: flex;
  gap: var(--flm-space-sm);
  flex-wrap: wrap;
}

.identity-social-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  border: 1px solid var(--flm-border);
  border-radius: var(--flm-radius-md);
  background: var(--flm-background);
  cursor: pointer;
  transition: var(--flm-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--flm-space-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--flm-text-secondary);
  text-decoration: none;
}

.identity-social-btn:hover {
  border-color: var(--flm-primary);
  background: var(--flm-primary-light);
  color: var(--flm-primary);
  text-decoration: none;
}

.identity-social-btn i {
  font-size: 18px;
}

/* Social provider colors */
.identity-social-btn-google:hover {
  border-color: #db4437;
  background: rgba(219, 68, 55, 0.1);
  color: #db4437;
}

.identity-social-btn-facebook:hover {
  border-color: #4267B2;
  background: rgba(66, 103, 178, 0.1);
  color: #4267B2;
}

.identity-social-btn-vk:hover {
  border-color: #4a76a8;
  background: rgba(74, 118, 168, 0.1);
  color: #4a76a8;
}

.identity-social-btn-apple:hover {
  border-color: #000000;
  background: rgba(0, 0, 0, 0.05);
  color: #000000;
}

/* ============================================================================
   Links
   ============================================================================ */

.identity-links {
  margin-top: var(--flm-space-lg);
  text-align: center;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: var(--flm-space-sm);
}

.identity-links-row {
  display: flex;
  justify-content: center;
  gap: var(--flm-space-lg);
  flex-wrap: wrap;
}

.identity-link {
  color: var(--flm-primary);
  text-decoration: none;
  transition: var(--flm-transition-fast);
}

.identity-link:hover {
  color: var(--flm-primary-hover);
  text-decoration: underline;
}

.identity-link-muted {
  color: var(--flm-text-secondary);
}

.identity-link-muted:hover {
  color: var(--flm-primary);
}

/* ============================================================================
   Validation & Alerts
   ============================================================================ */

.identity-error,
.field-validation-error {
  color: var(--flm-danger);
  font-size: 13px;
  margin-top: var(--flm-space-xs);
  display: block;
}

/* Hide empty validation summaries */
.identity-alert:empty,
.validation-summary-valid {
  display: none;
}

.identity-alert,
.validation-summary-errors {
  padding: var(--flm-space-md);
  border-radius: var(--flm-radius-md);
  margin-bottom: var(--flm-space-lg);
  font-size: 14px;
}

.identity-alert-danger,
.validation-summary-errors {
  background: rgba(220, 53, 69, 0.1);
  color: var(--flm-danger);
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: var(--flm-space-lg);
}

.identity-alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--flm-success);
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.identity-alert-info {
  background: var(--flm-primary-light);
  color: var(--flm-primary);
  border: 1px solid rgba(62, 181, 241, 0.2);
}

/* ============================================================================
   Checkbox & Remember Me
   ============================================================================ */

.identity-checkbox {
  display: flex;
  align-items: center;
  gap: var(--flm-space-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--flm-text-secondary);
}

.identity-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--flm-primary);
  cursor: pointer;
}

.identity-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--flm-space-md);
  margin-bottom: var(--flm-space-md);
}

/* ============================================================================
   Phone Input (intlTelInput)
   ============================================================================ */

.identity-phone-input .iti {
  width: 100%;
}

.identity-phone-input .iti__tel-input {
  width: 100%;
  padding: 12px 16px 12px 52px;
  font-size: 16px;
  border: 1px solid var(--flm-border);
  border-radius: var(--flm-radius-md);
  background: var(--flm-background);
  color: var(--flm-text-primary);
  transition: var(--flm-transition-fast);
}

.identity-phone-input .iti__tel-input:focus {
  outline: none;
  border-color: var(--flm-primary);
  box-shadow: 0 0 0 3px var(--flm-primary-light);
}

/* ============================================================================
   Accordion / FAQ (Simplified)
   ============================================================================ */

.identity-accordion {
  margin-bottom: var(--flm-space-lg);
  border: 1px solid var(--flm-border-light);
  border-radius: var(--flm-radius-md);
  overflow: hidden;
}

.identity-accordion-item {
  border-bottom: 1px solid var(--flm-border-light);
}

.identity-accordion-item:last-child {
  border-bottom: none;
}

.identity-accordion-title {
  padding: var(--flm-space-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--flm-text-primary);
  background: var(--flm-background-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--flm-transition-fast);
}

.identity-accordion-title:hover {
  background: var(--flm-primary-light);
  color: var(--flm-primary);
}

.identity-accordion-content {
  padding: var(--flm-space-md);
  font-size: 14px;
  color: var(--flm-text-secondary);
  line-height: 1.6;
  display: none;
}

.identity-accordion-item.active .identity-accordion-content {
  display: block;
}

/* ============================================================================
   Success / Confirmation States
   ============================================================================ */

.identity-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--flm-space-lg);
  background: rgba(40, 167, 69, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--flm-success);
  font-size: 32px;
}

.identity-success-message {
  text-align: center;
  color: var(--flm-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

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

@media (max-width: 480px) {
  .identity-main {
    padding: var(--flm-space-md);
    align-items: flex-start;
    padding-top: var(--flm-space-lg);
  }

  .identity-card {
    padding: var(--flm-space-lg);
    border-radius: var(--flm-radius-lg);
  }

  .identity-title {
    font-size: 20px;
  }

  .identity-form-row {
    flex-direction: column;
    gap: 0;
  }

  .identity-social-buttons {
    flex-direction: column;
  }

  .identity-social-btn {
    width: 100%;
  }

  .identity-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .identity-links-row {
    flex-direction: column;
    gap: var(--flm-space-sm);
  }
}

/* ============================================================================
   Legacy Compatibility - Override Bootstrap where needed
   ============================================================================ */

.identity-page .form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--flm-border);
  border-radius: var(--flm-radius-md);
  background: var(--flm-background);
  color: var(--flm-text-primary);
  transition: var(--flm-transition-fast);
  height: auto;
  box-shadow: none;
}

.identity-page .form-control:focus {
  outline: none;
  border-color: var(--flm-primary);
  box-shadow: 0 0 0 3px var(--flm-primary-light);
}

.identity-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--flm-radius-lg);
  transition: var(--flm-transition-fast);
  border: none;
}

.identity-page .btn-green,
.identity-page .btn-primary {
  background: var(--flm-primary);
  color: white;
}

.identity-page .btn-green:hover,
.identity-page .btn-primary:hover {
  background: var(--flm-primary-hover);
  transform: translateY(-1px);
}

.identity-page .text-danger {
  color: var(--flm-danger);
  font-size: 13px;
}

.identity-page hr {
  border: none;
  border-top: 1px solid var(--flm-border-light);
  margin: var(--flm-space-lg) 0;
}