/* ==========================================================================
   VaultEdu System Realm — Page-Specific Styles
   ========================================================================== */

/* — Login Page — */
.vlt-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-primary);
  position: relative;
  overflow: hidden;
}

.vlt-login__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(45, 212, 191, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
}

.vlt-login__card {
  position: relative;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-2xl);
}

.vlt-login__logo {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-lg);
}

.vlt-login__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.vlt-login__subtitle {
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

.vlt-login__realm-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-gold-light);
  color: var(--color-gold);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
}

.vlt-login__google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: white;
  color: #333;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vlt-login__google-btn:hover { background: #f8f8f8; box-shadow: var(--shadow-sm); }

.vlt-login__google-btn svg { width: 20px; height: 20px; }

.vlt-login__footer {
  margin-top: var(--space-8);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.vlt-login__error {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: none;
}

/* — Dashboard Stats Grid — */
.vlt-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* — Schools Grid — */
.vlt-schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-5);
}

.vlt-school-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vlt-school-card:hover { border-color: var(--color-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.vlt-school-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.vlt-school-card__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  flex-shrink: 0;
}

.vlt-school-card__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.vlt-school-card__code {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

.vlt-school-card__meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.vlt-school-card__colors {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

/* — Branding Grid — */
.vlt-branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.vlt-branding-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vlt-branding-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }

.vlt-branding-card__preview {
  height: 120px;
  position: relative;
}

.vlt-branding-card__body {
  padding: var(--space-4);
}

/* — Pipeline — */
.vlt-pipeline-stages {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

.vlt-pipeline-stage {
  flex: 0 0 280px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.vlt-pipeline-stage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

/* — Logs — */
.vlt-log-entry {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
}

.vlt-log-entry__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  min-width: 140px;
}

.vlt-log-entry__action {
  color: var(--color-text-secondary);
}

.vlt-log-entry__actor {
  color: var(--color-accent);
  font-weight: var(--weight-medium);
}

/* — Detail Sections — */
.vlt-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.vlt-detail-section {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.vlt-detail-section__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.vlt-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}

.vlt-detail-row__label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.vlt-detail-row__value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: var(--weight-medium);
}

/* ==========================================================================
   Branding Editor Page
   ========================================================================== */

/* — Filter Bar — */
.vlt-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* — Editor Layout: 2-column (editor left, preview right) — */
.vlt-editor-layout {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.vlt-editor-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.vlt-preview-panel {
  flex: 0 0 420px;
  min-width: 0;
}

.vlt-preview-sticky {
  position: sticky;
  top: calc(var(--header-height) + var(--space-8));
}

/* — Editor Sections — */
.vlt-editor-section {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.vlt-editor-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.vlt-editor-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.vlt-editor-section__title svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

/* — Color Pickers — */
.vlt-color-pickers {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.vlt-color-picker-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vlt-color-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.vlt-color-input {
  width: 44px;
  height: 36px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
  padding: 2px;
  flex-shrink: 0;
}

.vlt-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.vlt-color-input::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.vlt-color-hex {
  font-family: var(--font-mono) !important;
  font-size: var(--text-sm) !important;
  max-width: 160px;
}

/* — Option Grid (Brand Feel / Design Style selectors) — */
.vlt-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.vlt-option-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.vlt-option-card {
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.vlt-option-card:hover {
  border-color: var(--color-surface-border);
  background: var(--color-bg-hover);
}

.vlt-option-card.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.vlt-option-card__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.vlt-option-card.selected .vlt-option-card__name {
  color: var(--color-accent);
}

.vlt-option-card__desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Design Style swatch preview */
.vlt-option-card--style {
  padding: 0;
  overflow: hidden;
}

.vlt-option-card__swatch {
  display: flex;
  height: 32px;
  border-bottom: 1px solid var(--color-border);
}

.vlt-option-card--style .vlt-option-card__name {
  padding: var(--space-2) var(--space-3);
  margin-bottom: 0;
}

/* — Font Preview — */
.vlt-font-preview {
  padding: var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.vlt-font-preview__sample {
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.6;
}

.vlt-font-preview__sizes {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  color: var(--color-text-secondary);
}

/* — Logo Editor — */
.vlt-logo-editor {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.vlt-logo-preview {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-bg-tertiary);
  overflow: hidden;
}

/* ==========================================================================
   Live Preview Panel
   ========================================================================== */

.vlt-preview-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-3);
}

.vlt-preview-frame {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  min-height: 520px;
}

/* Mini Sidebar */
.vlt-preview-sidebar {
  width: 52px;
  background: var(--color-bg-primary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) 0;
  gap: var(--space-2);
  flex-shrink: 0;
}

.vlt-preview-sidebar__logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.vlt-preview-sidebar__item {
  width: 36px;
  height: 8px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.vlt-preview-sidebar__item.active {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Mini Main Content */
.vlt-preview-main {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
}

/* Preview Header */
.vlt-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.vlt-preview-header__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.vlt-preview-header__btn {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--weight-medium);
  background: var(--color-accent);
  color: var(--color-accent-text);
  white-space: nowrap;
}

/* Preview Stats */
.vlt-preview-stats {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.vlt-preview-stat {
  flex: 1;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.vlt-preview-stat__icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.vlt-preview-stat__value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: 1;
}

.vlt-preview-stat__label {
  font-size: 9px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

/* Preview Card */
.vlt-preview-card {
  margin: 0 var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.vlt-preview-card__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.vlt-preview-card__row {
  height: 6px;
  background: var(--color-bg-hover);
  border-radius: 3px;
  margin-bottom: var(--space-2);
}

.vlt-preview-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.vlt-preview-card__btn {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: var(--weight-medium);
  background: var(--color-accent);
  color: #fff;
}

/* Preview Table */
.vlt-preview-table {
  margin: 0 var(--space-4) var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.vlt-preview-table__header {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vlt-preview-table__header span { flex: 1; }

.vlt-preview-table__row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 10px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border-light);
}

.vlt-preview-table__row span { flex: 1; }

.vlt-preview-table__badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: var(--weight-medium);
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* — Responsive: Stack on smaller screens — */
@media (max-width: 1100px) {
  .vlt-editor-layout {
    flex-direction: column;
  }

  .vlt-preview-panel {
    flex: 1 1 auto;
    width: 100%;
  }

  .vlt-preview-sticky {
    position: static;
  }
}

@media (max-width: 640px) {
  .vlt-option-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vlt-option-grid--wide {
    grid-template-columns: repeat(2, 1fr);
  }

  .vlt-logo-editor {
    flex-direction: column;
    align-items: stretch;
  }

  .vlt-logo-preview {
    width: 100%;
    height: 100px;
  }

  .vlt-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .vlt-filter-bar .vlt-search { max-width: 100% !important; }
  .vlt-filter-bar .vlt-select { width: 100% !important; }
}

/* ==========================================================================
   Deploy Wizard
   ========================================================================== */

/* — Progress Steps — */
.vlt-deploy-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-4) 0;
}

.vlt-deploy-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.vlt-deploy-step__number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-tertiary);
  background: var(--color-bg-elevated);
  transition: all var(--transition-normal);
}

.vlt-deploy-step.active .vlt-deploy-step__number {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.vlt-deploy-step.completed .vlt-deploy-step__number {
  border-color: var(--color-success);
  color: #fff;
  background: var(--color-success);
}

.vlt-deploy-step__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.vlt-deploy-step.active .vlt-deploy-step__label {
  color: var(--color-accent);
}

.vlt-deploy-step.completed .vlt-deploy-step__label {
  color: var(--color-success);
}

.vlt-deploy-step__line {
  width: 80px;
  height: 2px;
  background: var(--color-border);
  margin: 0 var(--space-3);
  margin-bottom: var(--space-6);
  transition: background var(--transition-normal);
}

.vlt-deploy-step__line.active {
  background: var(--color-success);
}

/* — Deploy Panel — */
.vlt-deploy-panel {
  max-width: 700px;
  margin: 0 auto;
}

/* — Success Icon — */
.vlt-deploy-success-icon {
  display: inline-block;
  animation: vlt-deploy-success-pop 0.5s ease;
}

@keyframes vlt-deploy-success-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Settings Page
   ========================================================================== */

.vlt-settings-tab-content {
  /* No extra styles needed; visibility managed via .hidden */
}

/* ==========================================================================
   Pipeline Stage Cards (Kanban inline styles supplement)
   ========================================================================== */

.vlt-pipeline-stage__cards {
  display: flex;
  flex-direction: column;
  min-height: 100px;
}

/* ==========================================================================
   Responsive: Deploy + Settings
   ========================================================================== */

@media (max-width: 640px) {
  .vlt-deploy-progress {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .vlt-deploy-step__line {
    width: 40px;
    margin: 0 var(--space-1);
  }

  .vlt-deploy-panel {
    max-width: 100%;
  }
}
