/**
 * Contractor Registration Styles
 *
 * Complete styling for the contractor registration page
 * Matches the SubReady/Do It All Demo theme design system
 *
 * @package DoItAllDemo
 * @since 1.1.0
 */

/* ==========================================================================
   CSS Custom Properties for Registration
   ========================================================================== */

.contractor-registration-page {
    --reg-bg: var(--color-light-gray, #F8FAFC);
    --reg-card-bg: var(--color-clean-white, #FFFFFF);
    --reg-border: var(--color-border, #E2E8F0);
    --reg-navy: var(--color-navy-primary, #1B365D);
    --reg-amber: var(--color-amber-accent, #D97706);
    --reg-amber-hover: var(--color-amber-hover, #B45309);
    --reg-success: var(--color-success-green, #059669);
    --reg-error: var(--color-alert-red, #DC2626);
    --reg-text: var(--color-text-dark, #1E293B);
    --reg-text-muted: var(--color-text-muted, #64748B);
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

.contractor-registration-page {
    background: var(--reg-bg);
}

.contractor-registration {
    padding: var(--space-3xl, 64px) 0;
}

.contractor-registration__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl, 64px);
    align-items: start;
}

/* ==========================================================================
   Left Column: Info/Benefits
   ========================================================================== */

.contractor-registration__info {
    padding-top: var(--space-xl, 32px);
}

.contractor-registration__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm, 8px);
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    background: rgba(5, 150, 105, 0.1);
    color: var(--reg-success);
    border-radius: 9999px;
    font-size: var(--font-size-small, 14px);
    font-weight: var(--font-weight-semibold, 600);
    margin-bottom: var(--space-lg, 24px);
}

.contractor-registration__badge svg {
    flex-shrink: 0;
}

.contractor-registration__headline {
    font-size: var(--font-size-h1, 36px);
    font-weight: var(--font-weight-bold, 700);
    color: var(--reg-navy);
    line-height: var(--line-height-tight, 1.1);
    margin-bottom: var(--space-md, 16px);
}

.contractor-registration__lead {
    font-size: var(--font-size-body-lg, 18px);
    color: var(--reg-text-muted);
    line-height: var(--line-height-relaxed, 1.6);
    margin-bottom: var(--space-xl, 32px);
}

/* Benefits List */
.contractor-registration__benefits {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg, 24px);
    margin-bottom: var(--space-xl, 32px);
}

.contractor-registration__benefit {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md, 16px);
}

.contractor-registration__benefit svg {
    flex-shrink: 0;
    color: var(--reg-amber);
    margin-top: 2px;
}

.contractor-registration__benefit-content strong {
    display: block;
    font-size: var(--font-size-body, 16px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--reg-text);
    margin-bottom: var(--space-xs, 4px);
}

.contractor-registration__benefit-content p {
    font-size: var(--font-size-small, 14px);
    color: var(--reg-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Login Link */
.contractor-registration__login-link {
    padding-top: var(--space-xl, 32px);
    border-top: 1px solid var(--reg-border);
}

.contractor-registration__login-link p {
    font-size: var(--font-size-small, 14px);
    color: var(--reg-text-muted);
    margin-bottom: var(--space-sm, 8px);
}

/* ==========================================================================
   Right Column: Form Container
   ========================================================================== */

.contractor-registration__form-container {
    background: var(--reg-card-bg);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.2));
    padding: var(--space-xl, 32px);
    border: 1px solid var(--reg-border);
}

.contractor-registration__form h2 {
    font-size: var(--font-size-h2, 30px);
    font-weight: var(--font-weight-bold, 700);
    color: var(--reg-navy);
    margin-bottom: var(--space-xs, 4px);
}

.contractor-registration__form-subtitle {
    font-size: var(--font-size-body, 16px);
    color: var(--reg-text-muted);
    margin-bottom: var(--space-lg, 24px);
}

/* Error Message */
.contractor-registration__error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--reg-error);
    padding: var(--space-md, 16px);
    border-radius: var(--radius-md, 6px);
    font-size: var(--font-size-small, 14px);
    margin-bottom: var(--space-lg, 24px);
    border-left: 4px solid var(--reg-error);
}

/* Fieldsets */
.contractor-registration__fieldset {
    border: none;
    padding: 0;
    margin: 0 0 var(--space-xl, 32px) 0;
}

.contractor-registration__fieldset legend {
    font-size: var(--font-size-body, 16px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--reg-navy);
    margin-bottom: var(--space-md, 16px);
    padding-bottom: var(--space-sm, 8px);
    border-bottom: 2px solid var(--reg-border);
    width: 100%;
}

.contractor-registration__fieldset legend .required {
    color: var(--reg-amber);
}

/* Form Fields */
.contractor-registration__field {
    margin-bottom: var(--space-md, 16px);
}

.contractor-registration__field label {
    display: block;
    font-size: var(--font-size-small, 14px);
    font-weight: var(--font-weight-medium, 500);
    color: var(--reg-text);
    margin-bottom: var(--space-xs, 4px);
}

.contractor-registration__field label .required {
    color: var(--reg-error);
}

.contractor-registration__field input[type="text"],
.contractor-registration__field input[type="email"],
.contractor-registration__field input[type="tel"],
.contractor-registration__field input[type="password"],
.contractor-registration__field textarea,
.contractor-registration__field select {
    width: 100%;
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    font-size: var(--font-size-body, 16px);
    line-height: 1.5;
    color: var(--reg-text);
    background: var(--reg-card-bg);
    border: 2px solid var(--reg-border);
    border-radius: var(--radius-md, 6px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contractor-registration__field input:focus,
.contractor-registration__field textarea:focus,
.contractor-registration__field select:focus {
    outline: none;
    border-color: var(--reg-navy);
    box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.1);
}

.contractor-registration__field input::placeholder,
.contractor-registration__field textarea::placeholder {
    color: var(--reg-text-muted);
}

.contractor-registration__field textarea {
    min-height: 100px;
    resize: vertical;
}

.contractor-registration__field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.contractor-registration__hint {
    display: block;
    font-size: 12px;
    color: var(--reg-text-muted);
    margin-top: var(--space-xs, 4px);
}

/* Row Layout (side by side fields) */
.contractor-registration__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md, 16px);
}

/* ==========================================================================
   Checkbox Group (Services)
   ========================================================================== */

.contractor-registration__checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm, 8px);
}

.contractor-registration__checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
    cursor: pointer;
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    border: 2px solid var(--reg-border);
    border-radius: var(--radius-md, 6px);
    font-size: var(--font-size-small, 14px);
    color: var(--reg-text);
    transition: all 0.2s ease;
    user-select: none;
}

.contractor-registration__checkbox:hover {
    border-color: var(--reg-amber);
    background: rgba(217, 119, 6, 0.05);
}

.contractor-registration__checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.contractor-registration__checkbox .checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--reg-border);
    border-radius: var(--radius-sm, 4px);
    background: var(--reg-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.contractor-registration__checkbox .checkmark::after {
    content: '';
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.contractor-registration__checkbox input:checked ~ .checkmark {
    background: var(--reg-amber);
    border-color: var(--reg-amber);
}

.contractor-registration__checkbox input:checked ~ .checkmark::after {
    display: block;
}

.contractor-registration__checkbox:has(input:checked) {
    border-color: var(--reg-amber);
    background: rgba(217, 119, 6, 0.05);
}

/* ==========================================================================
   Password Strength Indicator
   ========================================================================== */

.contractor-registration__password-strength {
    margin-top: var(--space-sm, 8px);
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--reg-border);
    margin-bottom: var(--space-xs, 4px);
    overflow: hidden;
}

.strength-bar::after {
    content: '';
    display: block;
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-bar--weak::after {
    width: 33%;
    background: var(--reg-error);
}

.strength-bar--medium::after {
    width: 66%;
    background: var(--reg-amber);
}

.strength-bar--strong::after {
    width: 100%;
    background: var(--reg-success);
}

.strength-text {
    font-size: 12px;
    font-weight: var(--font-weight-semibold, 600);
}

.strength-bar--weak + .strength-text {
    color: var(--reg-error);
}

.strength-bar--medium + .strength-text {
    color: var(--reg-amber);
}

.strength-bar--strong + .strength-text {
    color: var(--reg-success);
}

.strength-missing {
    display: block;
    font-size: 11px;
    color: var(--reg-text-muted);
    margin-top: var(--space-xs, 4px);
}

/* ==========================================================================
   Policy Box
   ========================================================================== */

.contractor-registration__fieldset--terms {
    margin-bottom: var(--space-lg, 24px);
}

.contractor-registration__policy-box {
    background: var(--reg-bg);
    border: 1px solid var(--reg-border);
    border-radius: var(--radius-md, 6px);
    padding: var(--space-md, 16px);
    margin-bottom: var(--space-md, 16px);
}

.contractor-registration__policy-box h4 {
    font-size: var(--font-size-small, 14px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--reg-navy);
    margin-bottom: var(--space-sm, 8px);
}

.contractor-registration__policy-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contractor-registration__policy-box li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    color: var(--reg-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-xs, 4px);
}

.contractor-registration__policy-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--reg-amber);
    border-radius: 50%;
}

.contractor-registration__policy-box li:last-child {
    margin-bottom: 0;
}

/* Terms Checkbox */
.contractor-registration__checkbox--terms {
    border: none;
    padding: 0;
    background: none;
}

.contractor-registration__checkbox--terms:hover {
    border: none;
    background: none;
}

.contractor-registration__checkbox--terms a {
    color: var(--reg-navy);
    text-decoration: underline;
}

.contractor-registration__checkbox--terms a:hover {
    color: var(--reg-amber);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.contractor-registration__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 8px);
    width: 100%;
    padding: var(--space-md, 16px) var(--space-xl, 32px);
    font-size: var(--font-size-body-lg, 18px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-clean-white, #FFFFFF);
    background: var(--reg-amber);
    border: 2px solid var(--reg-amber);
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.contractor-registration__submit:hover {
    background: var(--reg-amber-hover);
    border-color: var(--reg-amber-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.contractor-registration__submit:active {
    transform: translateY(0);
}

.contractor-registration__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.contractor-registration__submit .btn__text {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm, 8px);
}

.contractor-registration__submit .btn__loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm, 8px);
}

.contractor-registration__submit .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Success State
   ========================================================================== */

.contractor-registration__success {
    text-align: center;
    padding: var(--space-3xl, 64px) var(--space-xl, 32px);
}

.contractor-registration__success svg {
    margin: 0 auto var(--space-lg, 24px);
}

.contractor-registration__success h3 {
    font-size: var(--font-size-h2, 30px);
    font-weight: var(--font-weight-bold, 700);
    color: var(--reg-success);
    margin-bottom: var(--space-md, 16px);
}

.contractor-registration__success p {
    font-size: var(--font-size-body, 16px);
    color: var(--reg-text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    .contractor-registration__wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-xl, 32px);
    }
    
    .contractor-registration__info {
        padding-top: 0;
        text-align: center;
    }
    
    .contractor-registration__badge {
        margin-left: auto;
        margin-right: auto;
    }
    
    .contractor-registration__benefits {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .contractor-registration__benefit {
        text-align: left;
    }
    
    .contractor-registration__login-link {
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .contractor-registration {
        padding: var(--space-xl, 32px) 0;
    }
    
    .contractor-registration__headline {
        font-size: var(--font-size-h2, 30px);
    }
    
    .contractor-registration__form-container {
        padding: var(--space-lg, 24px);
    }
    
    .contractor-registration__form h2 {
        font-size: var(--font-size-h3, 24px);
    }
    
    .contractor-registration__row {
        grid-template-columns: 1fr;
    }
    
    .contractor-registration__checkboxes {
        grid-template-columns: 1fr;
    }
    
    .contractor-registration__benefit {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .contractor-registration__benefit svg {
        margin-top: 0;
    }
    
    .contractor-registration__submit {
        font-size: var(--font-size-body, 16px);
        padding: var(--space-md, 16px);
    }
}
