@font-face {
  font-family: 'Windows XP Tahoma';
  src: url('windows-xp-tahoma.otf') format('opentype');
  font-display: swap;
}

:root {
  --win-font: 'Windows XP Tahoma', Tahoma, sans-serif;
  --win-bg: #008080;
  --win-face: #c0c0c0;
  --win-light: #ffffff;
  --win-highlight: #dfdfdf;
  --win-shadow: #808080;
  --win-dark: #000000;
  --win-title: #000080;
  --win-title-gradient: #1084d0;
}

* {
  box-sizing: border-box;
  font-family: var(--win-font) !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--win-bg);
  color: var(--win-dark);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.desktop {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Windows 95 Window */
.window {
  width: 100%;
  max-width: 650px;
  background: var(--win-face);
  padding: 3px;
  border: 1px solid var(--win-dark);
  box-shadow:
    inset 1px 1px 0px var(--win-light),
    inset -1px -1px 0px var(--win-shadow),
    inset 2px 2px 0px var(--win-highlight),
    inset -2px -2px 0px var(--win-shadow),
    1px 1px 0px var(--win-dark);
}

/* Title Bar - draggable on desktop */
.title-bar {
  background: linear-gradient(90deg, var(--win-title), var(--win-title-gradient));
  padding: 5px 6px 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  cursor: grab;
}

.title-bar:active {
  cursor: grabbing;
}

.title-bar-text {
  color: var(--win-light);
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-icon {
  font-size: 16px;
  line-height: 1;
}

.title-bar-controls {
  display: flex;
  gap: 3px;
  flex: none;
}

.title-bar-controls button {
  width: 18px;
  height: 16px;
  padding: 0;
  margin: 0;
  background: var(--win-face);
  border: none;
  box-shadow:
    inset 1px 1px 0px var(--win-light),
    inset -1px -1px 0px var(--win-dark),
    inset 2px 2px 0px var(--win-highlight),
    inset -2px -2px 0px var(--win-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.title-bar-controls .btn-close {
  margin-left: 2px;
}

.title-bar-controls button:active {
  box-shadow:
    inset -1px -1px 0px var(--win-light),
    inset 1px 1px 0px var(--win-dark),
    inset -2px -2px 0px var(--win-highlight),
    inset 2px 2px 0px var(--win-shadow);
  padding: 1px 0 0 1px;
}

/* Window Body */
.window-body {
  margin: 0;
  padding: 18px 18px 14px;
}

/* Wizard Layout */
.wizard-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.wizard-side {
  flex: 0 0 185px;
  height: 290px;
  background: var(--win-bg);
  border: 1px solid var(--win-dark);
  box-shadow:
    inset 1px 1px 0px var(--win-shadow),
    inset -1px -1px 0px var(--win-light),
    inset 2px 2px 0px var(--win-dark),
    inset -2px -2px 0px var(--win-highlight);
  overflow: hidden;
}

.wizard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.wizard-content {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.wizard-heading {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: bold;
  color: var(--win-dark);
}

.wizard-desc {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--win-dark);
}

/* Fields */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: bold;
}

/* Windows 95 Sunken Input */
.win-input {
  width: 100%;
  height: 36px;
  padding: 5px 10px;
  background: var(--win-light);
  color: var(--win-dark);
  border: none;
  outline: none;
  box-shadow:
    inset 1px 1px 0px var(--win-shadow),
    inset -1px -1px 0px var(--win-light),
    inset 2px 2px 0px var(--win-dark),
    inset -2px -2px 0px var(--win-highlight);
  font-size: 16px;
}

.win-input:focus {
  background: #ffffff;
}

/* Win95 Divider */
.win-divider {
  height: 0;
  border-top: 1px solid var(--win-shadow);
  border-bottom: 1px solid var(--win-light);
  margin: 18px 0 14px;
}

/* Form Actions / Buttons */
.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Windows 95 Raised Button */
.win-button {
  background: var(--win-face);
  color: var(--win-dark);
  border: none;
  outline: none;
  min-width: 105px;
  height: 34px;
  padding: 2px 20px;
  box-shadow:
    inset 1px 1px 0px var(--win-light),
    inset -1px -1px 0px var(--win-dark),
    inset 2px 2px 0px var(--win-highlight),
    inset -2px -2px 0px var(--win-shadow);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.win-button.primary-btn {
  outline: 1px solid var(--win-dark);
  outline-offset: 0;
}

.win-button:disabled {
  color: var(--win-shadow);
  text-shadow: 1px 1px 0px var(--win-light);
  cursor: default;
}

.win-button:not(:disabled):focus {
  outline: 1px dotted var(--win-dark);
  outline-offset: -4px;
}

.win-button:not(:disabled):active {
  box-shadow:
    inset -1px -1px 0px var(--win-light),
    inset 1px 1px 0px var(--win-dark),
    inset -2px -2px 0px var(--win-highlight),
    inset 2px 2px 0px var(--win-shadow);
  padding: 3px 19px 1px 21px;
}

/* Status Bar */
.status-bar {
  display: flex;
  gap: 2px;
  padding: 2px 1px 1px;
}

.status-panel {
  background: var(--win-face);
  box-shadow:
    inset 1px 1px 0px var(--win-shadow),
    inset -1px -1px 0px var(--win-light);
  padding: 4px 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-main {
  flex: 1;
}

.status-info {
  flex: 0 0 85px;
  text-align: center;
}

.status-main.success {
  color: #006000;
  font-weight: bold;
}

.status-main.error {
  color: #800000;
  font-weight: bold;
}

/* Mobile Fullscreen Mode */
@media (max-width: 640px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .desktop {
    padding: 0;
    min-height: 100%;
    height: 100%;
    display: block;
    background: var(--win-face);
  }

  .window {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .title-bar {
    cursor: default;
    padding: 8px 12px;
  }

  .title-bar-text {
    font-size: 15px;
  }

  .window-body {
    flex: 1;
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  /* Hide photo on mobile */
  .wizard-side {
    display: none;
  }

  .wizard-main {
    flex: none;
    display: block;
    margin-bottom: 20px;
  }

  .wizard-content {
    padding-top: 0;
  }

  .wizard-heading {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .wizard-desc {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .field label {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .win-input {
    height: 42px;
    font-size: 17px;
    padding: 8px 10px;
  }

  .win-divider {
    margin: 16px 0 16px;
  }

  .actions-row {
    margin-top: 8px;
  }

  .win-button {
    width: 100%;
    height: 44px;
    font-size: 16px;
  }

  .status-bar {
    margin-top: auto;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom)) 8px;
  }

  .status-panel {
    padding: 6px 10px;
    font-size: 13px;
  }
}
