@font-face {
    font-family: 'Baste B';
    src: url('/static/fonts/BasteB-Regular.woff2') format('woff2'),
         url('/static/fonts/BasteB-Regular.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Rubik';
    src: url('/static/fonts/Rubik-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Azeret Mono';
    src: url('/static/fonts/AzeretMono-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #070C0C;
    color: #F8FAF9;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-family: 'Baste B', sans-serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: #F8FAF9;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: #9C9E9E;
    font-size: 0.95rem;
}

.field {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #C8CAC9;
    margin-bottom: 0.375rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #161E27;
    border: 1px solid #333;
    border-radius: 6px;
    color: #F8FAF9;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: #8686FF;
}

.handle-row {
    display: flex;
    gap: 0.5rem;
}

.handle-row input {
    flex: 1;
}

.handle-row select {
    width: auto;
    min-width: 140px;
}

.hint {
    display: block;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: #6A6A6A;
    margin-top: 0.25rem;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #6060E9;
    color: #F8FAF9;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

button:hover { background: #4a4ad0; }
button:disabled {
    background: #333;
    color: #6A6A6A;
    cursor: not-allowed;
}

.error {
    color: #F40B42;
    font-size: 0.9rem;
    padding: 0.75rem;
    background: rgba(244, 11, 66, 0.1);
    border: 1px solid rgba(244, 11, 66, 0.3);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.error-box {
    text-align: center;
    padding: 1.5rem;
    background: rgba(244, 11, 66, 0.1);
    border: 1px solid rgba(244, 11, 66, 0.3);
    border-radius: 8px;
}

.error-box h2 {
    font-family: 'Baste B', sans-serif;
    color: #F40B42;
    margin-bottom: 0.5rem;
}

/* Step progress bar */
#step-progress-container {
    margin-bottom: 1rem;
}

.step-text {
    text-align: center;
    font-size: 1rem;
    color: #C8CAC9;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #161E27;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #6060E9;
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

.blob-progress-bar {
    height: 6px;
}

.blob-fill {
    background: #8686FF;
}

.progress-label {
    text-align: center;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: #9C9E9E;
}

.success {
    text-align: center;
    padding: 2rem 1rem;
}

.success h2 {
    font-family: 'Baste B', sans-serif;
    color: #D2FC51;
    margin-bottom: 0.75rem;
}

.success a {
    color: #8686FF;
}

/* Recovery key */
.recovery-box {
    background: rgba(210, 252, 81, 0.08);
    border: 1px solid rgba(210, 252, 81, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.recovery-box h3 {
    font-family: 'Baste B', sans-serif;
    color: #D2FC51;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.recovery-box p {
    color: #9C9E9E;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.recovery-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6A6A6A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    margin-top: 0.75rem;
}

.recovery-label:first-of-type {
    margin-top: 0;
}

.recovery-code {
    display: block;
    background: #161E27;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    color: #C8CAC9;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

#auth-factor-section,
#plc-section {
    padding: 1rem 0;
}

#auth-factor-section p,
#plc-section p {
    margin-bottom: 1rem;
    color: #9C9E9E;
}

/* Existing account / target password */
.existing-account-box {
    background: rgba(96, 96, 233, 0.08);
    border: 1px solid rgba(96, 96, 233, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.existing-account-box h3 {
    font-family: 'Baste B', sans-serif;
    color: #8686FF;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.existing-account-box p {
    color: #9C9E9E;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.reset-hint {
    background: rgba(255, 200, 50, 0.08);
    border: 1px solid rgba(255, 200, 50, 0.25);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.reset-hint p {
    font-size: 0.85rem;
    color: #9C9E9E;
    margin-bottom: 0.375rem;
}

.reset-hint p:last-child {
    margin-bottom: 0;
}

.reset-hint strong {
    color: #C8CAC9;
}

.reset-hint ul {
    margin: 0.375rem 0 0.375rem 1.25rem;
    font-size: 0.85rem;
}

.reset-hint li {
    color: #9C9E9E;
    margin-bottom: 0.25rem;
}

.reset-hint a {
    color: #8686FF;
    word-break: break-all;
}

.reset-email-hint {
    font-size: 0.8rem;
}

.reset-email-hint strong {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: #C8CAC9;
}

/* Dev mode */
.dev-banner {
    display: inline-block;
    background: rgba(210, 252, 81, 0.15);
    color: #D2FC51;
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(210, 252, 81, 0.3);
    margin-bottom: 1rem;
}

#dev-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #222;
}

@media (max-width: 520px) {
    .container { padding: 1.5rem 1rem; }
    .handle-row { flex-direction: column; gap: 0.5rem; }
    .handle-row select { min-width: unset; }
}
