/* =========================================
   V2SL CONTEST - FRONTEND STYLES
   ========================================= */

/* Base Section */
.v2sl-section {
    background-color: #ffffff;
    padding: 48px 32px;
    margin: 32px auto;
    max-width: 1200px;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(7, 55, 99, 0.05);
}

.v2sl-section--light {
    background: linear-gradient(135deg, #ffffff 0%, #f4f7fb 100%);
}

.v2sl-section__header {
    text-align: left;
    margin-bottom: 24px;
    border-left: 4px solid #073763;
    padding-left: 16px;
}

.v2sl-title {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 4px;
    color: #073763;
    font-weight: 700;
}

.v2sl-subtitle {
    margin: 0;
    color: #333333;
    font-size: 14px;
    opacity: 0.85;
}

/* Form Layout */
.v2sl-form {
    margin-top: 28px;
}

.v2sl-form__section {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(7, 55, 99, 0.08);
}

.v2sl-form__section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.v2sl-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #073763;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ED8323;
    display: inline-block;
}

/* Grid System */
.v2sl-grid {
    display: grid;
    gap: 20px;
}

.v2sl-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.v2sl-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.v2sl-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .v2sl-grid--2,
    .v2sl-grid--3,
    .v2sl-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .v2sl-grid--2,
    .v2sl-grid--3,
    .v2sl-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Form Fields */
.v2sl-field {
    margin-bottom: 16px;
}

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

.v2sl-required {
    color: #e74c3c;
}

.v2sl-field input[type="text"],
.v2sl-field input[type="email"],
.v2sl-field input[type="tel"],
.v2sl-field input[type="number"],
.v2sl-field input[type="url"],
.v2sl-field select,
.v2sl-field textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #dde3ec;
    padding: 12px 14px;
    font-size: 14px;
    color: #111111;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.v2sl-field textarea {
    resize: vertical;
    min-height: 100px;
}

.v2sl-field input:focus,
.v2sl-field select:focus,
.v2sl-field textarea:focus {
    outline: none;
    border-color: #073763;
    box-shadow: 0 0 0 3px rgba(7, 55, 99, 0.1);
}

/* Field States */
.v2sl-field--success input,
.v2sl-field--success select,
.v2sl-field--success textarea {
    border-color: #16a34a !important;
    background-color: #f0fdf4 !important;
}

.v2sl-field--error input,
.v2sl-field--error select,
.v2sl-field--error textarea,
.v2sl-field--error .v2sl-chip-picker,
.v2sl-field--error .v2sl-search-input {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}

.v2sl-field--error label {
    color: #dc2626;
}

/* Help Text */
.v2sl-help-text {
    font-size: 12px;
    color: #666666;
    margin: 6px 0;
    line-height: 1.4;
}

.v2sl-help-text--warning {
    color: #b45309;
    background: #fef3c7;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
    margin: 10px 0;
}

.v2sl-help-text code {
    background: #ED8323;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Buttons */
.v2sl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.v2sl-btn--primary {
    background: linear-gradient(135deg, #073763 0%, #0a4a7f 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(7, 55, 99, 0.3);
}

.v2sl-btn--primary:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(7, 55, 99, 0.4);
}

.v2sl-btn--primary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Alerts */
.v2sl-alert {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.v2sl-alert--hidden {
    display: none;
}

.v2sl-alert--success {
    background-color: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.v2sl-alert--error {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* =========================================
   COUNTRY DROPDOWN - STYLED
   ========================================= */
.v2sl-searchable-select {
    position: relative;
}

.v2sl-searchable-select .v2sl-search-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #dde3ec;
    padding: 12px 14px;
    font-size: 14px;
    color: #111111;
    background-color: #ffffff;
    cursor: text;
    box-sizing: border-box;
}

.v2sl-searchable-select .v2sl-search-input:focus {
    outline: none;
    border-color: #073763;
    box-shadow: 0 0 0 3px rgba(7, 55, 99, 0.1);
}

.v2sl-dropdown-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1000;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #dde3ec;
    display: none;
}

.v2sl-dropdown-list.v2sl-dropdown-open {
    display: block;
}

.v2sl-dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f4f6f9;
    transition: background-color 0.15s ease;
}

.v2sl-dropdown-item:last-child {
    border-bottom: none;
}

.v2sl-dropdown-item:hover,
.v2sl-dropdown-item.v2sl-dropdown-highlighted {
    background-color: #f0f7ff;
    color: #073763;
}

.v2sl-dropdown-item.v2sl-dropdown-selected {
    background-color: #e0efff;
    color: #073763;
    font-weight: 600;
}

.v2sl-dropdown-no-results {
    padding: 16px;
    font-size: 13px;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* =========================================
   CHIP PICKER - DISTRICTS & DEVICES
   ========================================= */
.v2sl-chip-picker {
    border-radius: 8px;
    border: 1px solid #dde3ec;
    padding: 10px 12px;
    background-color: #ffffff;
    cursor: text;
    min-height: 48px;
}

.v2sl-chip-picker:focus-within {
    border-color: #073763;
    box-shadow: 0 0 0 3px rgba(7, 55, 99, 0.1);
}

.v2sl-chip-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.v2sl-chip-selected:empty {
    margin-bottom: 0;
}

.v2sl-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    background: linear-gradient(135deg, #073763 0%, #0a4a7f 100%);
    color: #ffffff;
    gap: 6px;
    font-weight: 500;
}

.v2sl-chip__remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    margin-left: 4px;
}

.v2sl-chip__remove:hover {
    opacity: 1;
}

.v2sl-chip-input-wrap {
    position: relative;
}

.v2sl-chip-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    padding: 6px 0 !important;
    font-size: 14px;
    background: transparent !important;
    box-shadow: none !important;
}

.v2sl-chip-suggestions {
    position: absolute;
    left: -12px;
    right: -12px;
    top: 100%;
    z-index: 1000;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    border: 1px solid #dde3ec;
}

.v2sl-chip-suggestion {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f4f6f9;
    transition: background-color 0.15s ease;
}

.v2sl-chip-suggestion:last-child {
    border-bottom: none;
}

.v2sl-chip-suggestion:hover {
    background-color: #f0f7ff;
    color: #073763;
}

/* =========================================
   VERIFICATION STATUS
   ========================================= */
.v2sl-verify-box {
    margin-top: 10px;
}

.v2sl-verify-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.v2sl-verify-status.v2sl-status--success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.v2sl-verify-status.v2sl-status--error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.v2sl-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(7, 55, 99, 0.2);
    border-radius: 50%;
    border-top-color: #073763;
    animation: v2sl-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes v2sl-spin {
    to { transform: rotate(360deg); }
}

.v2sl-check {
    color: #16a34a;
    font-weight: bold;
    font-size: 16px;
}

.v2sl-cross {
    color: #dc2626;
    font-weight: bold;
    font-size: 16px;
}

/* =========================================
   TERMS & CHECKBOXES
   ========================================= */
.v2sl-field--terms {
    margin-bottom: 12px;
}

.v2sl-terms-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.v2sl-terms-choice input[type="checkbox"] {
    width: 20px !important;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.v2sl-terms-choice label {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    cursor: pointer;
    font-weight: 400;
}

.v2sl-terms-choice label a {
    color: #073763;
    text-decoration: underline;
}

/* Age Warning */
.v2sl-age-warning {
    font-size: 13px;
    color: #ea580c;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #ea580c;
}

/* NIC Hint */
.v2sl-nic-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* =========================================
   TOOLTIP
   ========================================= */
.v2sl-label-with-tooltip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2sl-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #073763;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    position: relative;
}

.v2sl-tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.v2sl-tooltip-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

/* =========================================
   FORM FOOTER
   ========================================= */
.v2sl-form__footer {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.v2sl-form__note {
    font-size: 13px;
    color: #666666;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .v2sl-section {
        padding: 24px 16px;
        margin: 16px;
        border-radius: 12px;
    }
    
    .v2sl-title {
        font-size: 22px;
    }
    
    .v2sl-section-title {
        font-size: 16px;
    }
    
    .v2sl-btn {
        width: 100%;
    }
}

/* reCAPTCHA responsive */
.g-recaptcha {
    transform-origin: left top;
}

@media (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.85);
    }
}

/* Hidden fields for conditional display */
#v2sl-local-fields,
#v2sl-foreign-fields,
.v2sl-foreign-field {
    transition: all 0.3s ease;
}
