/**
 * Frontend Styles for Sales Loss Audit & Lead Form
 */

.sa-form-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid #e5e7eb;
    max-width: 680px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
    position: relative;
    color: #1f2937;
}

.sa-form-card *,
.sa-form-card *::before,
.sa-form-card *::after {
    box-sizing: border-box;
}

.sa-form-header {
    text-align: center;
    margin-bottom: 28px;
}

.sa-form-badge {
    display: inline-block;
    background: rgba(0, 173, 92, 0.1);
    color: var(--sa-primary, #00AD5C);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.sa-form-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.sa-form-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.sa-field-group {
    margin-bottom: 22px;
}

.sa-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.sa-label .sa-required {
    color: #ef4444;
    margin-left: 3px;
}

.sa-label-sub {
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
}

/* Input Fields */
.sa-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sa-input-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.sa-input-text {
    width: 100% !important;
    padding: 13px 16px 13px 42px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #111827 !important;
    background: #f9fafb !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    height: auto !important;
    line-height: normal !important;
}

.sa-input-text:focus {
    border-color: #00AD5C !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 173, 92, 0.15) !important;
}

/* Chips / Option Cards Grid for Monthly Sales */
.sa-options-grid-sales {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 540px) {
    .sa-options-grid-sales {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sa-chip-label {
    display: block;
    position: relative;
    cursor: pointer;
    user-select: none;
    margin: 0 !important;
}

.sa-chip-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sa-chip-box {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 10px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
}

.sa-chip-label:hover .sa-chip-box {
    border-color: #00AD5C;
    background: #f0fdf4;
}

.sa-chip-label input[type="radio"]:checked + .sa-chip-box {
    border-color: #00AD5C;
    background: #ecfdf5;
    color: #008f4c;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(0, 173, 92, 0.2);
}

/* Options Grid for Where do you lose sales */
.sa-options-grid-loss {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 540px) {
    .sa-options-grid-loss {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sa-loss-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    transition: all 0.2s ease;
    height: 100%;
}

.sa-loss-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-chip-label:hover .sa-loss-box {
    border-color: #00AD5C;
    background: #f0fdf4;
}

.sa-chip-label input[type="radio"]:checked + .sa-loss-box {
    border-color: #00AD5C;
    background: #ecfdf5;
    color: #008f4c;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(0, 173, 92, 0.2);
}

.sa-chip-label input[type="radio"]:checked + .sa-loss-box .sa-loss-indicator {
    border-color: #00AD5C;
    background: #00AD5C;
}

.sa-chip-label input[type="radio"]:checked + .sa-loss-box .sa-loss-indicator::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    display: block;
}

/* Two columns row for Phone & Email */
.sa-row-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 540px) {
    .sa-row-2col {
        grid-template-columns: 1fr 1fr;
    }
}

/* Submit Button */
.sa-submit-btn {
    width: 100% !important;
    background: var(--sa-primary, #00AD5C) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 15px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(0, 173, 92, 0.25) !important;
    margin-top: 10px !important;
}

.sa-submit-btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 173, 92, 0.35) !important;
}

.sa-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Loading Spinner */
.sa-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: saSpin 0.8s linear infinite;
}

@keyframes saSpin {
    to { transform: rotate(360deg); }
}

/* Notice & Success States */
.sa-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
}

.sa-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.sa-notice-success-screen {
    text-align: center;
    padding: 40px 20px;
}

.sa-success-icon-wrap {
    width: 64px;
    height: 64px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #00AD5C;
}

.sa-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px 0;
}

.sa-success-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.sa-success-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    color: #4b5563;
    display: inline-block;
    text-align: left;
    max-width: 380px;
    width: 100%;
}

