/* ============================================================
   Skog & Stål — COMPONENTS (reusable UI atoms)
   buttons · badges · cards · forms · switch · slider
   ============================================================ */

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-size: var(--fs-body);
}

.btn-primary-green {
    background: linear-gradient(135deg, var(--color-forest), var(--color-forest-light));
    color: var(--color-white);
    box-shadow: 0 4px 15px var(--color-forest-tint);
}

.btn-primary-green:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--color-forest-glow);
}

.btn-primary-orange {
    background: linear-gradient(135deg, var(--color-welding), var(--color-welding-light));
    color: var(--color-white);
    box-shadow: 0 4px 15px var(--color-welding-tint);
}

.btn-primary-orange:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--color-welding-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-text);
    background: var(--color-ink-005);
}

.btn-gradient-split {
    background: var(--color-ink);
    color: var(--color-white);
    border: 1px solid var(--color-ink);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-gradient-split::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-ink-005);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    border-radius: var(--radius-pill);
}

.btn-gradient-split:hover {
    transform: translateY(-2px);
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-ink);
    box-shadow: var(--shadow-md);
}

.btn-gradient-split:hover::before {
    opacity: 1;
}

/* ===== Badges ===== */
.badge-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: var(--space-4);
}

.badge-green {
    background: var(--color-forest-badge-bg);
    color: var(--color-forest-light);
    border: 1px solid var(--color-forest-badge-border);
}

.badge-orange {
    background: var(--color-welding-badge-bg);
    color: var(--color-welding-light);
    border: 1px solid var(--color-welding-badge-border);
}

.badge-dual {
    background: var(--color-ink-005);
    color: var(--color-text);
    border: 1px solid var(--color-border-strong);
}

/* ===== Glass card ===== */
.glass-card {
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: var(--transition-smooth);
}

/* ===== Service card ===== */
.service-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-6);
    transition: var(--transition-smooth);
}

.service-card.service-green .service-icon-wrapper {
    background: var(--color-forest-tint);
    color: var(--color-forest);
    border: 1px solid var(--color-forest-tint-strong);
}

.service-card.service-orange .service-icon-wrapper {
    background: var(--color-welding-tint);
    color: var(--color-welding);
    border: 1px solid var(--color-welding-tint-strong);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: var(--space-3);
}

.service-card p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-5);
}

.service-features-list {
    margin-bottom: var(--space-6);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.service-features-list li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.service-card.service-green .service-features-list i {
    color: var(--color-forest);
}

.service-card.service-orange .service-features-list i {
    color: var(--color-welding);
}

.service-card-link {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
}

.service-card.service-green .service-card-link {
    color: var(--color-forest);
}

.service-card.service-orange .service-card-link {
    color: var(--color-welding);
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card.service-green:hover {
    border-color: var(--color-forest-tint-strong);
    box-shadow: 0 10px 30px var(--color-forest-tint);
}

.service-card.service-orange:hover {
    border-color: var(--color-welding-tint-strong);
    box-shadow: 0 10px 30px var(--color-welding-tint);
}

/* ===== Certification card ===== */
.cert-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.cert-card i {
    font-size: 1.5rem;
}

.cert-card.green i {
    color: var(--color-forest);
}

.cert-card.orange i {
    color: var(--color-welding);
}

.cert-card span {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

/* ===== Form controls ===== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.form-control {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-text);
    box-shadow: 0 0 0 3px var(--color-ink-005);
}

/* ===== Toggle switch (RUT-avdrag) ===== */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin: var(--space-6) 0;
}

.switch-label-wrapper {
    max-width: 75%;
}

.switch-label-wrapper strong {
    display: block;
    font-family: var(--font-heading);
    margin-bottom: 2px;
}

.switch-label-wrapper span {
    font-size: var(--fs-2xs);
    color: var(--color-text-muted);
}

.switch-btn {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch-btn input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--color-switch-track);
    transition: 0.4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--color-white);
    transition: 0.4s;
    border-radius: var(--radius-round);
}

input:checked + .switch-slider {
    background-color: var(--color-forest);
}

input:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* ===== Before/After comparison slider ===== */
.slider-comparison-box {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.img-before {
    background-image: url('../assets/tree_before.png');
    z-index: 1;
}

.img-after {
    background-image: url('../assets/tree_after.png');
    z-index: 2;
    width: 50%;
}

.slider-input {
    position: absolute;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    margin: 0;
    z-index: 5;
    cursor: ew-resize;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 4px;
    height: 400px;
    background: var(--color-white);
    cursor: ew-resize;
    box-shadow: 0 0 10px var(--color-scrim-strong);
}

.slider-input::-moz-range-thumb {
    width: 4px;
    height: 400px;
    background: var(--color-white);
    cursor: ew-resize;
    box-shadow: 0 0 10px var(--color-scrim-strong);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-round);
    background: var(--color-white);
    border: 3px solid var(--color-forest);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    box-shadow: var(--shadow-handle);
    pointer-events: none;
    transition: background 0.2s, border-color 0.2s;
}

.slider-comparison-box:hover .slider-handle {
    background: var(--color-ink);
    color: var(--color-white);
    border-color: var(--color-forest-light);
}

.slider-handle::before,
.slider-handle::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 200px;
    background: var(--color-white);
    z-index: 3;
}

.slider-handle::before {
    bottom: 44px;
}

.slider-handle::after {
    top: 44px;
}

.slider-label {
    position: absolute;
    bottom: 20px;
    padding: 6px 12px;
    background: var(--color-scrim);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    z-index: 3;
    pointer-events: none;
}

.label-before {
    left: 20px;
}

.label-after {
    right: 20px;
}
