/**
 * Breznblick - Wizard Stylesheet
 *
 * Standalone stylesheet for install.php wizard steps.
 * No dependency on the main app stylesheet.
 * Follows the UI-SPEC layout contract exactly.
 */

/* -------------------------------------------------------------------------
   Reset
   ---------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Outer wrap -- full-viewport centering
   ---------------------------------------------------------------------- */
.wizard-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* -------------------------------------------------------------------------
   Card
   ---------------------------------------------------------------------- */
.wizard-card {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 32px 40px;
}

/* -------------------------------------------------------------------------
   Step progress indicator
   ---------------------------------------------------------------------- */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.step {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #999;
    flex-shrink: 0;
}

.step.done {
    background: #555;
    border-color: #555;
    color: #fff;
}

.step.active {
    background: #3b3b3b;
    border-color: #3b3b3b;
    color: #fff;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    max-width: 40px;
}

.step-line.done {
    background: #555;
}

/* -------------------------------------------------------------------------
   Body / typography
   ---------------------------------------------------------------------- */
.wizard-body h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.wizard-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px;
}

/* -------------------------------------------------------------------------
   Form elements
   ---------------------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.form-hint {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease, outline-color 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #3b3b3b;
    outline: 2px solid #3b3b3b;
    outline-offset: 2px;
}

.select-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease, outline-color 0.15s ease;
}

.select-input:focus {
    border-color: #3b3b3b;
    outline: 2px solid #3b3b3b;
    outline-offset: 2px;
}

.field-error {
    display: block;
    font-size: 13px;
    color: #dc2626;
    margin-top: 4px;
    background: #fef2f2;
    border-radius: 4px;
    padding: 4px 8px;
}

.input-error {
    border-color: #dc2626 !important;
}

/* -------------------------------------------------------------------------
   System check rows
   ---------------------------------------------------------------------- */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.check-row.pass {
    background: #f0fdf4;
    color: #16a34a;
}

.check-row.fail {
    background: #fef2f2;
    color: #dc2626;
}

.check-label {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.check-fix {
    font-size: 13px;
    color: #555;
    display: block;
    margin-top: 4px;
    width: 100%;
}

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */
.btn-primary {
    background: #3b3b3b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: #1a1a1a;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: #3b3b3b;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
    border-color: #999;
    color: #1a1a1a;
}

/* -------------------------------------------------------------------------
   Navigation bar
   ---------------------------------------------------------------------- */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.wizard-nav .btn-primary:only-child {
    margin-left: auto;
}

/* -------------------------------------------------------------------------
   Theme tiles (step 4)
   ---------------------------------------------------------------------- */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.theme-tile {
    position: relative;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-tile.selected {
    border-color: #3b3b3b;
    box-shadow: 0 0 0 1px #3b3b3b;
}

.theme-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.theme-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* -------------------------------------------------------------------------
   OwnTracks endpoint display (step 6)
   ---------------------------------------------------------------------- */
.endpoint-display {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 14px;
    color: #1a1a1a;
    word-break: break-all;
}

/* -------------------------------------------------------------------------
   Summary (step 7)
   ---------------------------------------------------------------------- */
.wizard-summary {
    margin-bottom: 24px;
}

.wizard-summary dl {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 0;
}

.wizard-summary dt,
.wizard-summary dd {
    margin: 0;
    padding: 0;
}

.wizard-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wizard-summary .summary-row:last-child {
    border-bottom: none;
}

.wizard-summary dt {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.wizard-summary dd {
    font-size: 14px;
    color: #1a1a1a;
    text-align: right;
}

/* -------------------------------------------------------------------------
   Already-done icon (D-09)
   ---------------------------------------------------------------------- */
.already-done-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

/* -------------------------------------------------------------------------
   Skip option
   ---------------------------------------------------------------------- */
.skip-option {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* -------------------------------------------------------------------------
   API key group
   ---------------------------------------------------------------------- */
.api-key-group {
    transition: opacity 0.2s ease;
}

/* -------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */
@media (max-width: 600px) {
    .wizard-card {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .wizard-card {
        padding: 20px 16px;
    }

    .step {
        width: 28px;
        height: 28px;
    }

    .step-line {
        display: none;
    }
}
