/* Form Container - Inherits theme background or defaults to white */
.pwd-wcfm-wrap { 
    max-width: 680px; 
    margin: 0 auto; 
    font-family: inherit; 
    background: var(--wp--preset--color--base, var(--wp--preset--color--white, #ffffff));
    color: var(--wp--preset--color--contrast, inherit);
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--wp--preset--color--border, #e5e7eb);
}

/* Progress - Inherits theme primary color */
.pwd-wcfm-progress { margin-bottom: 24px; }
.pwd-wcfm-progress-bar { background: #e5e7eb; border-radius: 9999px; height: 8px; overflow: hidden; }
.pwd-wcfm-progress-fill { 
    background: var(--wp--preset--color--primary, var(--wp--custom--color--primary, #2563eb)); 
    height: 100%; 
    width: 0; 
    transition: width .3s; 
}
.pwd-wcfm-step-label { margin: 6px 0 0; font-size: 13px; color: var(--wp--preset--color--contrast-3, #6b7280); }

/* Steps */
.pwd-wcfm-step { display: none; }
.pwd-wcfm-step.pwd-active { display: block; }

/* Notices */
#pwd-wcfm-notices { margin-bottom: 16px; }
.pwd-notice { padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.pwd-notice-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.pwd-notice-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Fields */
.pwd-wcfm-field { margin-bottom: 20px; }
.pwd-wcfm-field.pwd-hidden-by-logic { display: none !important; }
.pwd-wcfm-field label { 
    display: block; 
    font-weight: 600; 
    font-size: 14px; 
    margin-bottom: 6px; 
    color: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, #111827)); 
}
.pwd-wcfm-field input[type="text"],
.pwd-wcfm-field input[type="email"],
.pwd-wcfm-field input[type="password"],
.pwd-wcfm-field input[type="tel"],
.pwd-wcfm-field input[type="number"],
.pwd-wcfm-field select,
.pwd-wcfm-field textarea {
    width: 100%; 
    padding: 10px 14px; 
    border: 1px solid var(--wp--preset--color--border, #d1d5db); 
    border-radius: 6px;
    font-size: 15px; 
    box-sizing: border-box; 
    background: var(--wp--preset--color--base, #fff); 
    color: var(--wp--preset--color--contrast, #111827);
    transition: border-color .2s;
}
.pwd-wcfm-field input::placeholder,
.pwd-wcfm-field select::placeholder,
.pwd-wcfm-field textarea::placeholder {
    color: var(--wp--preset--color--contrast-2, #9ca3af);
    opacity: 1;
}
.pwd-wcfm-field input:focus,
.pwd-wcfm-field select:focus,
.pwd-wcfm-field textarea:focus { 
    outline: none; 
    border-color: var(--wp--preset--color--primary, #2563eb); 
    box-shadow: 0 0 0 3px var(--wp--preset--color--primary-light, rgba(37,99,235,.1)); 
}
.pwd-wcfm-field input.pwd-error { border-color: #ef4444; }
.pwd-req { color: #ef4444; margin-left: 2px; }

/* Checkbox */
.pwd-checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: normal !important; cursor: pointer; }
.pwd-checkbox-label input { width: auto !important; }

/* Verify */
.pwd-verify-wrap { margin-top: 12px; }
#pwd-code-wrap { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#pwd-verify-code { 
    width: 180px !important; 
    letter-spacing: 8px; 
    font-size: 24px; 
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    padding: 14px 16px !important;
    background: var(--wp--preset--color--base, #f9fafb) !important;
    border: 2px solid var(--wp--preset--color--primary, #2563eb) !important;
    color: var(--wp--preset--color--contrast, #111827) !important;
}
#pwd-verify-code:focus {
    background: var(--wp--preset--color--base, #fff) !important;
    border-color: var(--wp--preset--color--primary, #2563eb) !important;
    box-shadow: 0 0 0 3px var(--wp--preset--color--primary-light, rgba(37,99,235,.15)) !important;
}
#pwd-verified-badge { color: #059669; font-weight: 600; font-size: 15px; }
#pwd-verified-badge::before { content: '✓ '; font-size: 18px; }

/* Password toggle */
.pwd-password-wrap { position: relative; display: block; }
.pwd-wcfm-field .pwd-password-wrap input[type="password"],
.pwd-wcfm-field .pwd-password-wrap input[type="text"] {
    padding-right: 50px !important; /* Make space for toggle button */
}
.pwd-password-wrap .pwd-toggle-password {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 8px !important;
    color: #6b7280;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: color .2s;
    z-index: 10;
    margin: 0 !important;
}
.pwd-password-wrap .pwd-toggle-password:hover { 
    color: var(--wp--preset--color--primary, #2563eb); 
}
.pwd-password-wrap .pwd-toggle-password .pwd-eye-icon { width: 20px; height: 20px; }

/* Nav */
.pwd-wcfm-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid #e5e7eb; flex-wrap: wrap; gap: 12px; }

/* Buttons - Inherit theme primary color */
.pwd-btn { 
    padding: 10px 22px; 
    border-radius: 6px; 
    border: none; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all .2s;
    font-family: inherit;
}
.pwd-btn-primary  { 
    background: var(--wp--preset--color--primary, var(--wp--custom--color--primary, #2563eb)); 
    color: var(--wp--preset--color--base, #fff); 
}
.pwd-btn-primary:hover  { 
    background: var(--wp--preset--color--primary-hover, var(--wp--custom--color--primary-dark, #1d4ed8)); 
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.pwd-btn-secondary { 
    background: transparent; 
    color: var(--wp--preset--color--primary, #2563eb); 
    border: 2px solid var(--wp--preset--color--primary, #2563eb); 
}
.pwd-btn-secondary:hover { 
    background: var(--wp--preset--color--primary-light, #eff6ff); 
}
.pwd-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Autosave */
.pwd-autosave-msg { font-size: 12px; color: #6b7280; margin-top: 8px; }
