/**
 * Demo Request Form Styles
 *
 * @package WowCodes_Demo_Provisioner
 */

/* ── Wrapper ─────────────────────────────── */
.wcdemo-form-wrapper {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ── Product badge ───────────────────────── */
.wcdemo-product-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
}

.wcdemo-product-badge .wcdemo-tagline {
    display: block;
    font-size: 13px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 4px;
}

/* ── Form fields ─────────────────────────── */
.wcdemo-field {
    margin-bottom: 20px;
}

.wcdemo-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1e293b;
}

.wcdemo-field input[type="text"],
.wcdemo-field input[type="email"],
.wcdemo-field input[type="password"],
.wcdemo-field select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.wcdemo-field input:focus,
.wcdemo-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.wcdemo-field input.wcdemo-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wcdemo-field input.wcdemo-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ── Honeypot (hidden) ───────────────────── */
/* ── Toggle switch (sample data) ─────────── */
.wcdemo-toggle-field {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.wcdemo-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 400;
}

.wcdemo-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wcdemo-toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.wcdemo-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.wcdemo-toggle input:checked + .wcdemo-toggle-slider {
    background: #7c3aed;
}

.wcdemo-toggle input:checked + .wcdemo-toggle-slider::after {
    transform: translateX(20px);
}

.wcdemo-toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.wcdemo-toggle-field .wcdemo-field-hint {
    margin: 8px 0 0 56px;
}

/* ── Honeypot (hidden) ───────────────────── */
.wcdemo-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ── Slug / site name input ──────────────── */
.wcdemo-slug-input {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.wcdemo-slug-input:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.wcdemo-slug-prefix {
    padding: 10px 0 10px 14px;
    font-size: 14px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.wcdemo-slug-input input[type="text"] {
    border: none !important;
    box-shadow: none !important;
    padding: 10px 14px 10px 2px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    flex: 1;
    min-width: 0;
    outline: none;
}

.wcdemo-slug-input input[type="text"]:focus {
    box-shadow: none !important;
    border: none !important;
}

/* ── Check availability button (inside slug + username) ── */
.wcdemo-check-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: #f0f2ff;
    border: none;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wcdemo-check-btn:hover {
    background: #e0e5ff;
    color: #4f46e5;
}

.wcdemo-check-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wcdemo-check-btn-spinner {
    display: inline-flex;
    align-items: center;
}

/* ── Input with check button (username) ── */
.wcdemo-input-with-check {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.wcdemo-input-with-check:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.wcdemo-input-with-check input[type="text"] {
    border: none !important;
    box-shadow: none !important;
    padding: 10px 14px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    flex: 1;
    min-width: 0;
    outline: none;
}

.wcdemo-input-with-check input[type="text"]:focus {
    box-shadow: none !important;
    border: none !important;
}

/* ── Input with password toggle ── */
.wcdemo-input-with-toggle {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.wcdemo-input-with-toggle:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.wcdemo-input-with-toggle input[type="password"],
.wcdemo-input-with-toggle input[type="text"] {
    border: none !important;
    box-shadow: none !important;
    padding: 10px 14px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    flex: 1;
    min-width: 0;
    outline: none;
}

.wcdemo-input-with-toggle input:focus {
    box-shadow: none !important;
    border: none !important;
}

.wcdemo-eye-btn {
    padding: 8px 12px;
    background: none;
    border: none;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.wcdemo-eye-btn:hover {
    color: #475569;
}

/* ── Hint status colors ── */
.wcdemo-field-hint.is-success {
    color: #10b981;
    font-weight: 600;
}

.wcdemo-field-hint.is-error {
    color: #ef4444;
    font-weight: 600;
}

.wcdemo-field-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 4px 0 0;
}

/* ── Submit button ───────────────────────── */
.wcdemo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

.wcdemo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.wcdemo-btn:active {
    transform: translateY(0);
}

.wcdemo-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wcdemo-btn-secondary {
    background: #64748b;
}

.wcdemo-btn-secondary:hover {
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.4);
}

/* ── Note text ───────────────────────────── */
.wcdemo-note {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin-top: 12px;
}

/* ── Success panel ───────────────────────── */
.wcdemo-success {
    text-align: center;
    padding: 20px 0;
    animation: wcdemo-fadein 0.4s ease;
}

.wcdemo-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    line-height: 64px;
    font-weight: bold;
}

.wcdemo-success h3 {
    font-size: 22px;
    color: #1e293b;
    margin: 0 0 20px;
}

/* ── Credentials card ────────────────────── */
.wcdemo-credentials {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: left;
}

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

.wcdemo-cred-row:last-child {
    border-bottom: none;
}

.wcdemo-cred-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.wcdemo-cred-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}

a.wcdemo-cred-value {
    color: #667eea;
    text-decoration: none;
}

a.wcdemo-cred-value:hover {
    text-decoration: underline;
}

/* ── Error panel ─────────────────────────── */
.wcdemo-error {
    text-align: center;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    animation: wcdemo-fadein 0.4s ease;
}

.wcdemo-error p {
    color: #dc2626;
    font-weight: 500;
    margin: 0 0 16px;
}

/* ── Provisioning progress panel ──────────── */
.wcdemo-progress {
    animation: wcdemo-fadein 0.4s ease;
    padding: 10px 0;
}

.wcdemo-progress-header {
    text-align: center;
    margin-bottom: 28px;
}

.wcdemo-progress-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    color: #667eea;
}

.wcdemo-progress-spinner svg {
    width: 100%;
    height: 100%;
}

.wcdemo-progress-header h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 4px;
}

.wcdemo-progress-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* Steps list */
.wcdemo-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
}

.wcdemo-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.3s, opacity 0.3s;
    opacity: 0.4;
}

.wcdemo-step.is-active {
    opacity: 1;
    background: #f0f2ff;
}

.wcdemo-step.is-done {
    opacity: 0.7;
}

/* Step icon — circle → spinner → check */
.wcdemo-step-icon {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.3s, background 0.3s;
}

.wcdemo-step.is-active .wcdemo-step-icon {
    border-color: #667eea;
    background: #fff;
}

/* Active spinning dot */
.wcdemo-step.is-active .wcdemo-step-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: #667eea;
    animation: wcdemo-pulse 1s ease-in-out infinite;
}

/* Done checkmark */
.wcdemo-step.is-done .wcdemo-step-icon {
    border-color: #10b981;
    background: #10b981;
}

.wcdemo-step.is-done .wcdemo-step-icon::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: none;
}

/* Failed cross */
.wcdemo-step.is-failed .wcdemo-step-icon {
    border-color: #ef4444;
    background: #ef4444;
}

.wcdemo-step.is-failed .wcdemo-step-icon::before,
.wcdemo-step.is-failed .wcdemo-step-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    animation: none;
    border: none;
    margin: 0;
}

.wcdemo-step.is-failed .wcdemo-step-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.wcdemo-step.is-failed .wcdemo-step-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.wcdemo-step.is-failed .wcdemo-step-label {
    color: #ef4444;
    font-weight: 600;
    text-decoration: none;
}

/* Step label */
.wcdemo-step-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    transition: color 0.3s;
}

.wcdemo-step.is-active .wcdemo-step-label {
    color: #1e293b;
    font-weight: 600;
}

.wcdemo-step.is-done .wcdemo-step-label {
    color: #64748b;
    text-decoration: line-through;
    text-decoration-color: #cbd5e1;
}

/* Progress bar */
.wcdemo-progress-bar-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.wcdemo-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.6s ease, background 0.3s ease;
}

.wcdemo-progress-bar-fill.is-error {
    background: #ef4444;
}

/* Progress inline error */
.wcdemo-progress-inline-error {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    animation: wcdemo-fadein 0.4s ease;
}

.wcdemo-progress-error-msg {
    color: #dc2626;
    font-weight: 500;
    font-size: 14px;
    margin: 0 0 12px;
}

.wcdemo-progress-inline-error .wcdemo-btn {
    width: auto;
    padding: 10px 24px;
    font-size: 14px;
}

/* ── Slug-taken options panel ─────────────── */
.wcdemo-slug-options {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 10px;
    animation: wcdemo-fadein 0.4s ease;
}

.wcdemo-slug-taken-msg {
    color: #92400e;
    font-weight: 500;
    font-size: 14px;
    margin: 0 0 14px;
}

.wcdemo-slug-options-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcdemo-btn-sm {
    width: 100%;
    padding: 10px 20px;
    font-size: 13px;
}

.wcdemo-btn-outline {
    background: transparent;
    color: #475569;
    border: 2px solid #cbd5e1;
}

.wcdemo-btn-outline:hover {
    background: #f8fafc;
    box-shadow: none;
    color: #1e293b;
}

.wcdemo-suggested-slug {
    font-family: monospace;
}

@keyframes wcdemo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.6); opacity: 0.5; }
}

/* ── Animation ───────────────────────────── */
@keyframes wcdemo-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 520px) {
    .wcdemo-form-wrapper {
        padding: 0 16px;
    }

    .wcdemo-cred-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}
