/* ==========================================================================
   Easy Security Wizard - Frontend Styles
   Modern, Clean, Responsive Design
   ========================================================================== */

:root {
    --esw-primary: #03AEEF;
    --esw-primary-hover: #009ad4;
    --esw-primary-light: rgba(3, 174, 239, 0.1);
    --esw-success: #10b981;
    --esw-warning: #f59e0b;
    --esw-danger: #ef4444;
    --esw-text: #1e293b;
    --esw-text-secondary: #64748b;
    --esw-bg: #f8fafc;
    --esw-card-bg: #ffffff;
    --esw-border: #e2e8f0;
    --esw-shadow-sm: 0px 4px 69px 0px rgba(0, 0, 0, 0.05);
    --esw-shadow: 0px 4px 69px 0px rgba(0, 0, 0, 0.05);
    --esw-shadow-lg: 0px 4px 69px 0px rgba(0, 0, 0, 0.05);
    --esw-radius: 20px;
    --esw-radius-sm: 8px;
    --esw-transition: all 0.2s ease;
}

.esw-theme-dark {
    --esw-text: #f1f5f9;
    --esw-text-secondary: #94a3b8;
    --esw-bg: #0f172a;
    --esw-card-bg: #1e293b;
    --esw-border: #334155;
}

.esw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container */
.esw-container {
    margin: 0 auto;
    padding: 20px;
    font-family: "Montserrat", Sans-serif;
    color: var(--esw-text);
}

/* Progress Bar */
.esw-progress-wrapper {
    margin-bottom: 30px;
}

.esw-progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.esw-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: var(--esw-transition);
}

.esw-step-item.active { opacity: 1; }
.esw-step-item.completed { opacity: 0.7; }

.esw-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--esw-border);
    color: var(--esw-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: var(--esw-transition);
}

.esw-step-item.active .esw-step-number {
    background: var(--esw-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--esw-primary-light);
}

.esw-step-item.completed .esw-step-number {
    background: var(--esw-success);
    color: #fff;
}

.esw-step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--esw-text-secondary);
}

.esw-step-item.active .esw-step-label { color: var(--esw-text); }

.esw-step-line {
    width: 60px;
    height: 2px;
    background: var(--esw-border);
}

.esw-progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.esw-progress-fill {
    height: 100%;
    border-radius: 10px;
    background-image: linear-gradient(90deg, #FC00FF 0%, #00DBDE 50%, #FC00FF 100%);
    background-size: 200% 100%;
    animation: eswProgressAnimation 3s ease infinite;
    transition: width 0.5s ease;
    position: relative;
}

.esw-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    border-radius: 10px;
}

@keyframes eswProgressAnimation {
    0% { background-position: 200%; }
    50% { background-position: 100%; }
    100% { background-position: 0%; }
}

/* Card */
.esw-card {
    background: var(--esw-card-bg);
    border-radius: var(--esw-radius);
    box-shadow: var(--esw-shadow);
    overflow: hidden;
}

.esw-card-header {
    padding: 30px 30px 20px;
}

.esw-card-footer {
    padding: 20px 30px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.esw-card-footer-between {
    justify-content: space-between;
}

/* Typography */
.esw-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--esw-text);
    margin: 0 0 8px;
    text-align: center;
}

.esw-subtitle {
    font-size: 0.95rem;
    color: var(--esw-text-secondary);
    margin: 0;
    text-align: center;
    padding-bottom: 30px;
}

/* Steps Animation */
.esw-step {
    display: none;
    animation: eswFadeIn 0.4s ease;
}

.esw-step-active { display: block; }

@keyframes eswFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Categories Grid */
.esw-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 0 30px;
    margin-bottom: 20px;
}

.esw-category-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--esw-bg);
    border: 1px solid var(--esw-border);
    border-radius: var(--esw-radius-sm);
    cursor: pointer;
    transition: var(--esw-transition);
}

.esw-category-card:hover {
    border-color: var(--esw-primary);
    box-shadow: var(--esw-shadow-sm);
    transform: translateY(-2px);
}

.esw-category-input { position: absolute; opacity: 0; width: 0; height: 0; }

.esw-category-input:checked + .esw-category-check {
    background: var(--esw-primary);
    border-color: var(--esw-primary);
}

.esw-category-input:checked + .esw-category-check svg {
    opacity: 1;
    transform: scale(1);
}

.esw-category-card:has(.esw-category-input:checked) {
    border-color: var(--esw-primary);
    background: var(--esw-primary-light);
}

.esw-category-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid var(--esw-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--esw-transition);
    margin-top: 2px;
}

.esw-category-check svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--esw-transition);
}

.esw-category-content { display: flex; flex-direction: column; gap: 4px; }
.esw-category-name { font-weight: 600; font-size: 0.9rem; color: var(--esw-text); }
.esw-category-desc { font-size: 0.8rem; color: var(--esw-text-secondary); }

/* Select All */
.esw-select-all-wrapper {
    padding: 0 30px;
    margin-bottom: 15px;
}

.esw-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--esw-text-secondary);
}

.esw-checkbox-label input[type="checkbox"] {
    display: none !important;
}

.esw-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--esw-border);
    border-radius: 4px;
    position: relative;
    transition: var(--esw-transition);
    flex-shrink: 0;
}

.esw-checkbox-label input[type="checkbox"]:checked + .esw-checkbox-custom {
    background: var(--esw-primary);
    border-color: var(--esw-primary);
}

.esw-checkbox-label input[type="checkbox"]:checked + .esw-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Warning Banner */
.esw-warning-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    margin: 0 30px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--esw-radius-sm);
    color: var(--esw-danger);
    font-size: 0.9rem;
    text-align: center;
}

.esw-warning-link {
    color: var(--esw-danger);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.esw-warning-link:hover {
    color: #b91c1c;
}

/* Info Banner */
.esw-question-count-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

.esw-info-banner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--esw-primary-light);
    border-radius: 50px;
    color: var(--esw-primary);
    font-size: 0.9rem;
    text-align: center;
}

/* Buttons */
.esw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--esw-transition);
    border: none;
    text-decoration: none;
}

.esw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.esw-btn-primary {
    padding: 14px 30px !important;
    font-family: 'Montserrat', Sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #FFFFFF !important;
    background: #00B2F0 !important;
    border: none !important;
    border-radius: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease, transform 0.2s ease !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4em !important;
    box-shadow: none !important;
}

.esw-btn-primary:hover:not(:disabled) {
    box-shadow: var(--esw-shadow);
    transform: translateY(-1px);
    background: #009ad4 !important;
    transform: translateY(-1px) !important;
}

.esw-btn-outline {
    color: var(--esw-text-secondary) !important;
    background: transparent !important;
    border: 2px solid var(--esw-border) !important;
    padding: 14px 30px !important;
    font-family: 'Montserrat', Sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    border-radius: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease, transform 0.2s ease !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4em !important;
    box-shadow: none !important;
}

.esw-btn-outline:hover {
    border-color: var(--esw-primary) !important;
    color: var(--esw-primary) !important;
    background: var(--esw-primary-light) !important;
}

.esw-btn-spinner {
    display: inline-flex;
    animation: eswSpin 0.6s linear infinite;
}

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

/* Questions */
.esw-questions-container { padding: 0 30px; }

.esw-question {
    padding: 24px;
    margin-bottom: 16px;
    background: var(--esw-bg);
    border-radius: var(--esw-radius-sm);
    border: 1px solid var(--esw-border);
    animation: eswSlideIn 0.3s ease;
}

@keyframes eswSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.esw-question-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--esw-text);
    margin-bottom: 16px;
}

.esw-question-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--esw-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.esw-options { display: flex; flex-wrap: wrap; gap: 10px; }

.esw-option-label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 12px !important;
    background: var(--esw-card-bg) !important;
    border: 1px solid var(--esw-border) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--esw-text) !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.esw-option-label:hover {
    border-color: var(--esw-primary) !important;
    background: var(--esw-primary-light) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(3, 174, 239, 0.15) !important;
}

.esw-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.esw-option-label:has(.esw-option-input:checked),
.esw-option-label.esw-option-selected {
    border-color: var(--esw-primary) !important;
    background: linear-gradient(135deg, var(--esw-primary), var(--esw-primary-hover)) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(3, 174, 239, 0.3) !important;
    transform: translateY(-1px);
}

.esw-option-label:has(.esw-option-input:checked)::before,
.esw-option-label.esw-option-selected::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 12px;
    margin-right: 4px;
}

/* Note */
.esw-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    margin: 16px 30px 0;
    background: var(--esw-primary-light);
    border-radius: 50px;
    color: var(--esw-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

/* Results - Gauge Card */
.esw-results-container { padding: 0 30px; }

.esw-gauge-card {
    background: var(--esw-card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 45px -15px rgba(20,25,40,.25);
    padding: 36px 10px 30px 0px;
    width: 340px;
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
}

.esw-gauge-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--esw-text-secondary);
    letter-spacing: .3px;
    margin: 0 0 18px;
}

.esw-gauge-wrap {
    position: relative;
    width: 280px;
    height: 210px;
    margin: 0 auto;
}

.esw-gauge-wrap svg {
    display: block;
    overflow: visible;
}

.esw-tick-label {
    font-size: 11px;
    fill: var(--esw-text-secondary);
    font-weight: 600;
}

.esw-needle {
    transform-box: view-box;
    transform-origin: 140px 140px;
    transition: transform 1.4s cubic-bezier(.34,1.4,.4,1);
}

.esw-gauge-value {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    text-align: center;
}

.esw-gauge-score {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    transition: color .6s ease;
}

.esw-gauge-max {
    font-size: 15px;
    color: var(--esw-text-secondary);
    font-weight: 600;
}

.esw-gauge-label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;
    transition: color .6s ease;
}

/* Results - Accordion Style (matching old plugin) */

.esw-accordion {
    margin: 16px 0;
    border: 1px solid var(--esw-border);
    border-radius: var(--esw-radius);
    overflow: hidden;
    background: var(--esw-card-bg);
}

.esw-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--esw-primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--esw-transition);
    user-select: none;
}

.esw-accordion-header:hover { opacity: 0.95; }

.esw-accordion-icon {
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.esw-accordion-content {
    padding: 20px;
    background: var(--esw-card-bg);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.esw-accordion-hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
    overflow: hidden;
}

.esw-accordion-open {
    max-height: 2000px;
    opacity: 1;
}

/* Score Results */
.esw-results-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--esw-text);
    margin: 0 0 20px;
}

.esw-score-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.esw-score-label {
    width: 160px;
    font-weight: 500;
    color: var(--esw-text);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.esw-score-percent {
    width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--esw-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.esw-score-bar-track {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.esw-score-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #e8483b 0%, #f5a623 25%, #f4d13d 50%, #8bc34a 75%, #2ecc71 100%);
    background-size: 200% 100%;
    transition: width 0.8s ease;
}

/* Suggestion Text */
.esw-suggestion-text {
    padding: 14px 0;
    border-bottom: 1px solid var(--esw-border);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--esw-text);
}

.esw-suggestion-text:last-child { border-bottom: none; }

.esw-progress-track {
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.esw-progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    background-image: linear-gradient(90deg, #FC00FF 0%, #00DBDE 50%, #FC00FF 100%);
    background-size: 200% 100%;
    animation: eswProgressAnimation 3s ease infinite;
    transition: width 0.8s ease;
    position: relative;
}

/* Contact Form */
.esw-form-group {
    margin-bottom: 4px;
}

.esw-input-field {
    width: 100% !important;
    padding: 14px 16px !important;
    font-family: 'Montserrat', Sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.4em !important;
    color: #333333 !important;
    outline: none !important;
    box-shadow: none !important;
    margin-bottom: 15px !important;
    background: #FFFFFF !important;
    border: 1px solid #CCCCCC !important;
    border-radius: 8px !important;
    transition: border-color 0.3s ease !important;
}

.esw-input-field::placeholder {
    color: var(--esw-text-secondary);
}

.esw-input-field:focus {
    border-color: var(--esw-primary);
    box-shadow: 0 0 0 3px var(--esw-primary-light);
}

.esw-input-field.esw-error {
    border-color: var(--esw-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.esw-field-error {
    display: block;
    color: var(--esw-danger);
    font-size: 0.8rem;
    margin-top: 6px;
}

.esw-action-wrapper {
    margin-top: 12px;
}

.esw-submit-btn {
    width: 100% !important;
    padding: 14px 30px !important;
    font-family: 'Montserrat', Sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #FFFFFF !important;
    background: #00B2F0 !important;
    border: none !important;
    border-radius: 15px !important;
    cursor: pointer !important;
    transition: background 0.3s ease, transform 0.2s ease !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4em !important;
    box-shadow: none !important;
}

.esw-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--esw-shadow);
    background: #009ad4 !important;
    transform: translateY(-1px) !important;
}

.esw-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.esw-disabled-notice {
    text-align: center;
    padding: 40px;
    color: var(--esw-text-secondary);
}

/* reCAPTCHA */
.esw-recaptcha-wrapper {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .esw-container { padding: 15px; }
    .esw-card-header { padding: 20px; }
    .esw-card-footer { padding: 15px 20px 20px; flex-direction: column; }
    .esw-card-footer .esw-btn { width: 100%; }
    .esw-categories-grid { grid-template-columns: 1fr; padding: 0 20px; }
    .esw-questions-container, .esw-results-container { padding: 0 20px; }
    .esw-note { margin: 16px 20px 0; }
    .esw-select-all-wrapper { padding: 0 20px; }
    .esw-info-banner { margin: 0 20px 15px; }
    .esw-progress-steps { flex-wrap: wrap; }
    .esw-step-line { display: none; }
    .esw-step-label { display: none; }
    .esw-title { font-size: 1.25rem; }
    .esw-options { flex-direction: column; }
    .esw-option-label { width: 100%; justify-content: center; }
    .esw-score-label { width: 120px; font-size: 0.8rem; }
    #esw-contact-form-wrapper { padding: 10px; }
    #esw-contact-form { padding: 20px; }
}

@media (max-width: 480px) {
    .esw-categories-grid { gap: 8px; }
    .esw-category-card { padding: 12px; }
    .esw-question { padding: 16px; }
    .esw-score-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .esw-score-label { width: 100%; }
}
