/* IEE Solar Checkliste - Pipedrive Light Theme */

:root {
    --primary: #017737;
    --primary-dark: #015a2a;
    --primary-light: #00a650;
    --secondary: #2a3f54;
    --bg-white: #ffffff;
    --bg-light: #f8f9fb;
    --bg-card: #ffffff;
    --bg-input: #f0f2f5;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #017737;
    --error: #dc2626;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Calculator Box */
.calculator-box {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 3px solid var(--primary);
}

.calculator-box h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: var(--primary);
}

.calculator-box .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.calculated-value {
    background: var(--bg-white);
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border);
    text-align: center;
}

/* Result Field Style (Input-like but green text) */
.price-result-field {
    color: var(--primary-dark) !important;
    /* Dark Green */
    font-weight: 700;
    background-color: #f0fdf4;
    /* Very light green bg */
    border-color: var(--primary-light);
}

/* Third width columns */
.form-group.third {
    flex: 1;
    min-width: 0;
}

/* Prognose Box */
.prognose-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.prognose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
}

.prognose-header span {
    font-weight: 600;
    color: var(--secondary);
}

#totalKwhPrognose {
    color: var(--primary);
    font-size: 1.1rem;
}

.prognose-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.prognose-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.prognose-item .val {
    color: var(--text);
    font-weight: 500;
}

/* Info Box */
.info-box {
    background: var(--bg-input);
    padding: 0.75rem;
    border-radius: 6px;
}

.info-box label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.info-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-white);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary) 0%, #4a6fa5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.form-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Form Elements */
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
    min-width: 200px;
}

.form-group.half {
    flex: 0 0 calc(50% - 0.5rem);
    min-width: 150px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 0.5rem;
}

.search-container input {
    flex: 1;
}

.search-results {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--border);
}

.selected-lead {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
    display: none;
}

.selected-lead.active {
    display: block;
}

/* Radio & Checkbox */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.875rem;
}

.radio-label:hover,
.checkbox-label:hover {
    background: var(--border);
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(1, 119, 55, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    color: var(--secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-link:hover {
    background: var(--border);
}

.form-actions {
    margin-top: 2rem;
}

/* Status Message */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.status-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.status-message.loading {
    display: block;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-content input {
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .form-group.half {
        flex: 1 1 100%;
    }

    .radio-group {
        flex-direction: column;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

/* Section Hint */
.section-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: -0.5rem;
}

/* Note Preview Modal */
.note-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.note-preview-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.note-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.note-preview-header h3 {
    color: var(--primary);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text);
}

.note-preview-content textarea {
    flex: 1;
    margin: 1rem 1.5rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: monospace;
    font-size: 0.875rem;
    resize: none;
    min-height: 300px;
}

.note-preview-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.note-preview-actions button {
    flex: 1;
}

/* Credits Footer */
.credits {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.credits a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

.credits a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-screen.hidden {
    display: none;
}

.login-content {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-content h1 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.login-content>p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-content input {
    padding: 1rem;
    font-size: 1rem;
    text-align: center;
}

.login-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 1rem;
    min-height: 1.5rem;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
}

.login-footer a:hover {
    color: var(--primary-light);
}
/* New Phase 5 Styles */

/* Utility for hidden elements */
.hidden {
    display: none !important;
}

/* Margin top utility */
.mt-2 {
    margin-top: 0.5rem;
}

/* WKD Link Green Style (Same as Price Result) */
.wkd-link {
    color: #015a2a !important; /* Dark Green */
    font-weight: 500;
}

/* Ensure Info Bottom fields have consistent spacing */
.info-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #e5e7eb;
}

/* Phase 6 Styles */
.radio-group.vertical {
    flex-direction: column;
    gap: 0.35rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
