/**
 * GP Set Password — v1.0.0
 */

/* ═══════════════════════ LAYOUT ═══════════════════════ */

#sp-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 24px;
}

.sp-container {
    width: 100%;
    max-width: 440px;
}

.sp-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════ HEADER ═══════════════════════ */

.sp-header {
    text-align: center;
    padding: 32px 32px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sp-logo {
    width: 52px;
    height: 52px;
    background: #1e293b;
    color: #fff;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.sp-header h1 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
    font-weight: 700;
}

.sp-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #64748b;
}

/* ═══════════════════════ BODY SECTIONS ═══════════════════════ */

.sp-body {
    padding: 28px 32px 32px;
}

/* Loading */
.sp-spinner {
    font-size: 28px;
    color: #3b82f6;
    margin-bottom: 12px;
    text-align: center;
}
.sp-body > p {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Error */
.sp-error-icon {
    text-align: center;
    font-size: 42px;
    color: #ef4444;
    margin-bottom: 12px;
}
#sp-error h2 {
    text-align: center;
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
}
#sp-error p {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Success */
.sp-success-icon {
    text-align: center;
    font-size: 48px;
    color: #16a34a;
    margin-bottom: 12px;
}
#sp-success h2 {
    text-align: center;
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
}
#sp-success p {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ═══════════════════════ FORM ═══════════════════════ */

.sp-welcome {
    font-size: 14px;
    color: #475569;
    margin: 0 0 24px;
    line-height: 1.5;
}

.sp-field {
    margin-bottom: 18px;
}

.sp-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sp-input {
    width: 100%;
    height: 44px;
    padding: 0 42px 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.sp-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.sp-input::placeholder {
    color: #94a3b8;
}

.sp-toggle-pw {
    position: absolute;
    right: 4px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 6px;
    transition: color 0.15s;
}
.sp-toggle-pw:hover {
    color: #475569;
}

/* Match error */
.sp-match-error {
    font-size: 12px;
    color: #ef4444;
    margin: 6px 0 0;
}

/* API error */
.sp-api-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ═══════════════════════ STRENGTH INDICATOR ═══════════════════════ */

.sp-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 16px;
}

.sp-str-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}
.sp-str-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.sp-str-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sp-str-weak  .sp-str-fill, .sp-str-weak  { background: #ef4444; color: #ef4444; }
.sp-str-fair   .sp-str-fill, .sp-str-fair   { background: #f59e0b; color: #f59e0b; }
.sp-str-good   .sp-str-fill, .sp-str-good   { background: #22c55e; color: #22c55e; }
.sp-str-strong .sp-str-fill, .sp-str-strong { background: #16a34a; color: #16a34a; }

/* Fix: only color fill and label, not the bar track */
.sp-str-weak  { background: transparent; }
.sp-str-fair   { background: transparent; }
.sp-str-good   { background: transparent; }
.sp-str-strong { background: transparent; }
.sp-str-weak.sp-str-fill  { background: #ef4444; }
.sp-str-fair.sp-str-fill   { background: #f59e0b; }
.sp-str-good.sp-str-fill   { background: #22c55e; }
.sp-str-strong.sp-str-fill { background: #16a34a; }

/* ═══════════════════════ BUTTONS ═══════════════════════ */

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
}
.sp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sp-btn-primary {
    background: #2563eb;
    color: #fff;
}
.sp-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.sp-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.sp-btn-secondary:hover {
    background: #e2e8f0;
}

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */

@media (max-width: 480px) {
    #sp-wrapper { padding: 16px; }
    .sp-card { border-radius: 12px; }
    .sp-header { padding: 24px 20px 20px; }
    .sp-body { padding: 24px 20px 28px; }
}