/* Styles du plugin Calculateur Loyer Commercial Maroc */

.clcm-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    gap: 2rem;
    align-items: flex-start;
    margin: 2rem 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 900px) {
    .clcm-wrapper {
        grid-template-columns: 1fr;
    }
}

.clcm-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 1.25rem;
    padding: 1.8rem 2rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    color: #e5e7eb;
    position: relative;
    overflow: hidden;
}

.clcm-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.35), transparent 55%),
                radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.28), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.clcm-card > * {
    position: relative;
    z-index: 1;
}

.clcm-card-form {
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.clcm-card-results {
    border: 1px solid rgba(52, 211, 153, 0.5);
}

.clcm-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 0.5rem;
}

.clcm-subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: #cbd5f5;
}

/* Toggle mode */

.clcm-mode-toggle {
    display: inline-flex;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.7);
    margin-bottom: 0.8rem;
}

.clcm-switch-option {
    position: relative;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e5e7eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.clcm-switch-option input {
    display: none;
}

.clcm-switch-option.clcm-switch-active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #022c22;
}

/* Form */

.clcm-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.clcm-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.clcm-field-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
}

.clcm-field-group input,
.clcm-field-group select {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 0.65rem 0.9rem;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.clcm-field-group input::placeholder {
    color: #9ca3af;
}

.clcm-field-group input:focus,
.clcm-field-group select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
    background: rgba(15, 23, 42, 1);
}

.clcm-help {
    font-size: 0.78rem;
    color: #cbd5f5;
}

/* Mode blocks */

.clcm-mode-block {
    display: none;
}

.clcm-mode-block.clcm-mode-active {
    display: block;
}

.clcm-btn {
    margin-top: 0.8rem;
    border: none;
    border-radius: 999px;
    padding: 0.8rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #052e16;
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.clcm-btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.55);
}

.clcm-btn:active {
    transform: translateY(0);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.35);
}

/* Results */

.clcm-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 1rem;
}

.clcm-results-section {
    margin-top: 1.3rem;
}

.clcm-results-section h4 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0 0 0.7rem;
    color: #e5e7eb;
}

.clcm-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.clcm-result-item {
    background: rgba(15, 23, 42, 0.82);
    border-radius: 0.9rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.clcm-result-label {
    display: block;
    font-size: 0.75rem;
    color: #cbd5f5;
    margin-bottom: 0.15rem;
}

.clcm-result-value {
    font-size: 1rem;
    font-weight: 700;
    color: #f9fafb;
}

.clcm-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 0.9rem;
    overflow: hidden;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.85);
}

.clcm-table thead {
    background: rgba(15, 118, 110, 0.9);
}

.clcm-table th,
.clcm-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.clcm-table th {
    font-weight: 600;
    color: #e0f2f1;
}

.clcm-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.9);
}

.clcm-table tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.7);
}

.clcm-table tbody tr:hover {
    background: rgba(8, 47, 73, 0.9);
}

.clcm-summary .clcm-result-item {
    border-color: rgba(52, 211, 153, 0.6);
}

/* Sections spécifiques : crédit & saroute */

.clcm-form-section {
    border-radius: 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    padding: 0.9rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.clcm-form-section-header label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    cursor: pointer;
}

.clcm-form-section-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.clcm-form-section-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.clcm-double-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

@media (max-width: 600px) {
    .clcm-double-fields {
        grid-template-columns: 1fr;
    }
}

.clcm-loan .clcm-result-item {
    border-color: rgba(59, 130, 246, 0.7);
}

.clcm-loan-note {
    margin-top: 0.7rem;
    font-size: 0.78rem;
    color: #cbd5f5;
}

.clcm-form-section-saroute {
    border-style: solid;
    border-color: rgba(251, 191, 36, 0.65);
}

.clcm-saroute .clcm-result-item {
    border-color: rgba(251, 191, 36, 0.75);
}

.clcm-saroute-note {
    margin-top: 0.7rem;
    font-size: 0.78rem;
    color: #fde68a;
}

.clcm-disclaimer {
    margin-top: 1.1rem;
    font-size: 0.76rem;
    color: #e5e7eb;
    opacity: 0.9;
}
