/**
 * SJ CRM Signup Form Styles
 */

.sj-crm-signup-form-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.sj-crm-signup-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.sj-crm-signup-form h2 {
    margin: 0 0 5px;
    font-size: 28px;
    color: #1e3a5f;
    text-align: center;
}

.sj-crm-signup-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 30px;
}

.sj-crm-signup-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sj-crm-signup-section:last-of-type {
    border-bottom: none;
}

.sj-crm-signup-section h3 {
    font-size: 16px;
    color: #333;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    display: inline-block;
}

.sj-crm-form-row {
    margin-bottom: 20px;
}

.sj-crm-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.sj-crm-form-row label .required {
    color: #dc3545;
}

.sj-crm-form-row input[type="text"],
.sj-crm-form-row input[type="email"],
.sj-crm-form-row input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.sj-crm-form-row input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.sj-crm-form-row small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

.sj-crm-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 500px) {
    .sj-crm-form-row-half {
        grid-template-columns: 1fr;
    }
}

/* Subdomain input styling */
.sj-crm-subdomain-input {
    display: flex;
    align-items: stretch;
}

.sj-crm-subdomain-input input {
    border-radius: 4px 0 0 4px;
    border-right: none;
    flex: 1;
}

.sj-crm-subdomain-input .sj-crm-domain-suffix {
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

/* Subdirectory prefix styling */
.sj-crm-subdomain-input .sj-crm-domain-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

.sj-crm-subdomain-input .sj-crm-domain-prefix + input {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.sj-crm-subdomain-input .sj-crm-domain-prefix + input + .sj-crm-domain-suffix {
    padding: 0 10px;
    border-radius: 0 4px 4px 0;
}

/* Checkbox */
.sj-crm-form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.sj-crm-form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
}

.sj-crm-form-checkbox a {
    color: #0073aa;
    text-decoration: none;
}

.sj-crm-form-checkbox a:hover {
    text-decoration: underline;
}

/* Submit button */
.sj-crm-signup-submit {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #0073aa, #005f8c);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sj-crm-signup-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.sj-crm-signup-submit:active {
    transform: translateY(0);
}

/* Login link */
.sj-crm-signup-login {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.sj-crm-signup-login a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.sj-crm-signup-login a:hover {
    text-decoration: underline;
}

/* Messages */
.sj-crm-signup-error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sj-crm-signup-success {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
}

.sj-crm-signup-success h2 {
    margin: 0 0 15px;
    color: #28a745;
}

.sj-crm-signup-success p {
    color: #666;
    margin: 10px 0;
}

.sj-crm-signup-success a {
    color: #0073aa;
    font-weight: 600;
}

.sj-crm-signup-message {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    color: #004085;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

.sj-crm-signup-message a {
    color: #0056b3;
    font-weight: 600;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sj-crm-signup-form {
        background: #1e1e1e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    
    .sj-crm-signup-form h2 {
        color: #fff;
    }
    
    .sj-crm-signup-subtitle {
        color: #aaa;
    }
    
    .sj-crm-signup-section {
        border-bottom-color: #333;
    }
    
    .sj-crm-signup-section h3 {
        color: #fff;
    }
    
    .sj-crm-form-row label {
        color: #ddd;
    }
    
    .sj-crm-form-row input[type="text"],
    .sj-crm-form-row input[type="email"],
    .sj-crm-form-row input[type="password"] {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .sj-crm-form-row input::placeholder {
        color: #888;
    }
    
    .sj-crm-subdomain-input .sj-crm-domain-suffix {
        background: #333;
        border-color: #444;
        color: #aaa;
    }
    
    .sj-crm-form-row small {
        color: #888;
    }
}

/* =========================================
   Plan Selection Styles
   ========================================= */

.sj-crm-plan-selection {
    margin-bottom: 30px;
}

/* Billing Toggle */
.sj-crm-billing-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    background: #f5f5f5;
    padding: 6px;
    border-radius: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.billing-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.billing-btn:hover {
    color: #333;
}

.billing-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.billing-btn .save-badge {
    background: #10b981;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Plans Grid */
.sj-crm-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Plan Card */
.sj-crm-plan-card {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.sj-crm-plan-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.sj-crm-plan-card.popular {
    border-color: #0073aa;
}

.sj-crm-plan-card.selected {
    border-color: #0073aa;
    background: rgba(0, 115, 170, 0.05);
}

.sj-crm-plan-card .popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #0073aa;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.sj-crm-plan-card h4 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}

.sj-crm-plan-card .plan-price {
    margin-bottom: 10px;
}

.sj-crm-plan-card .plan-price .currency {
    font-size: 16px;
    vertical-align: top;
}

.sj-crm-plan-card .plan-price .amount {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.sj-crm-plan-card .plan-price .period {
    font-size: 14px;
    color: #888;
}

.sj-crm-plan-card .trial-info {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.sj-crm-plan-card .plan-features-mini {
    list-style: none;
    padding: 0;
    margin: 0 0 15px;
    text-align: left;
}

.sj-crm-plan-card .plan-features-mini li {
    font-size: 12px;
    color: #666;
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
}

.sj-crm-plan-card .plan-features-mini li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.sj-crm-plan-card .select-plan-btn {
    width: 100%;
    padding: 10px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sj-crm-plan-card .select-plan-btn:hover {
    background: #005f8c;
}

.sj-crm-plan-card.selected .select-plan-btn {
    background: #10b981;
}

/* Selected Plan Summary */
.sj-crm-selected-plan {
    background: rgba(0, 115, 170, 0.05);
    border-radius: 6px;
    padding: 15px 20px !important;
    margin-bottom: 25px !important;
    border-bottom: none !important;
}

.selected-plan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-plan-summary .plan-name {
    font-weight: 600;
    color: #333;
}

.selected-plan-summary .plan-price {
    font-weight: 700;
    color: #0073aa;
}

.selected-plan-summary .change-plan {
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.selected-plan-summary .change-plan:hover {
    text-decoration: underline;
}

/* Responsive Plan Selection */
@media (max-width: 600px) {
    .sj-crm-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .sj-crm-plan-card.popular {
        order: -1;
    }
}

/* Dark mode plan selection */
@media (prefers-color-scheme: dark) {
    .sj-crm-billing-toggle {
        background: #333;
    }
    
    .billing-btn {
        color: #aaa;
    }
    
    .billing-btn.active {
        background: #444;
        color: #fff;
    }
    
    .sj-crm-plan-card {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .sj-crm-plan-card:hover,
    .sj-crm-plan-card.selected {
        border-color: #0073aa;
    }
    
    .sj-crm-plan-card h4 {
        color: #fff;
    }
    
    .sj-crm-plan-card .plan-price .amount {
        color: #fff;
    }
    
    .sj-crm-plan-card .plan-features-mini li {
        color: #aaa;
    }
    
    .sj-crm-selected-plan {
        background: rgba(0, 115, 170, 0.15);
    }
    
    .selected-plan-summary .plan-name {
        color: #fff;
    }
}
