* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wildfire-widget {
    max-width: 600px;
    margin: 20px auto;
    background: linear-gradient(135deg, #012c42 0%, #002639 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    position: relative;
    overflow: hidden;
}

.wildfire-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.widget-content {
    position: relative;
    z-index: 1;
}

.widget-header {
    text-align: center;
    margin-bottom: 30px;
}

.widget-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.widget-subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

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

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.input-field {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-field:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Override browser autocomplete dark background */
.input-field:-webkit-autofill,
.input-field:-webkit-autofill:hover,
.input-field:-webkit-autofill:focus,
.input-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Force white background for address input specifically (Google Places) */
#address-input {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

#address-input:focus {
    background-color: rgba(255, 255, 255, 1) !important;
}

/* Override any Google Places autocomplete background colors */
#address-input:-webkit-autofill,
#address-input:-webkit-autofill:hover,
#address-input:-webkit-autofill:focus,
#address-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.95) inset !important;
    -webkit-text-fill-color: #333 !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* For Google Places Autocomplete styling */
.pac-item {
    background-color: white !important;
}

.pac-item:hover {
    background-color: #f0f0f0 !important;
}

.address-helper {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
    font-style: italic;
}

/* Google Maps Autocomplete Styling */
.pac-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: none;
    margin-top: 5px;
    overflow: hidden;
}

.pac-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.pac-item:hover,
.pac-item.pac-item-selected {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

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

.pac-item-query {
    font-weight: 600;
}

.pac-matched {
    font-weight: 700;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.5;
}

.checkbox {
    margin-top: 2px;
    transform: scale(1.2);
}

.primary-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #fe9e19, #fe9e19);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 136, 0, 0.4);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 136, 0, 0.6);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.risk-score-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    backdrop-filter: blur(10px);
}

.risk-score-number {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-box {
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #d0d0d0; /* Thin grey outline */
    background-color: #6c757d; /* Default grey */
    color: #000000; /* Black text */
    font-size: 48px;
    font-weight: 900;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Same as widget font */
    text-align: center;
    line-height: 76px; /* Adjusted for border */
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.risk-score-label {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.risk-address {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

.payment-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    color: #333;
    backdrop-filter: blur(10px);
}

.payment-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* Stripe Elements Styling */
#card-element {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: border-color 0.3s ease;
}

#card-element:focus-within {
    border-color: #ffeb3b;
    outline: none;
}

#card-element.StripeElement--focus {
    border-color: #ffeb3b;
}

#card-element.StripeElement--invalid {
    border-color: #ff5722;
}

#card-errors {
    color: #ff5722;
    font-size: 14px;
    margin-top: 8px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: rgba(0, 255, 0, 0.1);
    color: #44ff44;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.report-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    color: #333;
    backdrop-filter: blur(10px);
}

.report-section {
    margin-bottom: 25px;
}

.report-section h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 16px;
}

.report-section p {
    line-height: 1.6;
    color: #555;
}

/* Risk level text styling - bold and colored to match score box */
#risk-level-text {
    font-weight: bold;
    text-transform: uppercase;
}

.risk-level-high { color: #ff4444; }
.risk-level-medium { color: #ff8800; }
.risk-level-low { color: #44aa44; }

.widget-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.8;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: 400px;
    color: #333;
    line-height: 1.6;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body a {
    color: #667eea;
}

.modal-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Table styles for EULA content */
.table-container {
    overflow-x: auto;
    margin: 15px 0;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.modal-body th,
.modal-body td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.modal-body th {
    background: #f5f5f5;
    font-weight: 600;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 16px;
}

.modal-body h4 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-body h3:first-child {
    margin-top: 0;
}