/* ==========================================================================
   KREDYTY PAGE - Darmowe Kredyty na Narzędzia
   Style specyficzne dla kredyty.html (prefix .kd-*)
   ========================================================================== */

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.kd-hero {
    padding: 6rem 0 3rem;
    background: var(--index-bg-gradient);
    text-align: center;
}

.kd-hero .container {
    max-width: var(--index-container-max);
    margin: 0 auto;
    padding: 0 var(--index-container-padding);
}

.kd-hero h1 {
    font-family: var(--index-font-serif);
    font-size: var(--index-text-5xl);
    font-weight: 700;
    color: var(--index-charcoal);
    line-height: var(--index-leading-tight);
    margin: 0 0 1rem;
}

.kd-hero .kd-subtitle {
    font-family: var(--index-font-primary);
    font-size: var(--index-text-xl);
    color: var(--index-charcoal-80);
    max-width: 720px;
    margin: 0 auto 1rem;
    line-height: var(--index-leading-relaxed);
}

.kd-hero .kd-value-badge {
    display: inline-block;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    font-family: var(--index-font-primary);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   WIDGET SECTION
   ========================================================================== */

.kd-widget {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}

.kd-search {
    background: white;
    border: 2px solid rgba(44, 38, 37, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(44, 38, 37, 0.06);
}

.kd-search:focus-within {
    border-color: var(--warmth-accent);
    box-shadow: 0 4px 20px rgba(42, 92, 78, 0.12);
}

.kd-search textarea {
    width: 100%;
    border: none;
    outline: none;
    font-family: var(--index-font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--index-charcoal);
    background: transparent;
    resize: vertical;
    min-height: 80px;
}

.kd-search textarea::placeholder {
    color: rgba(44, 38, 37, 0.4);
}

.kd-search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(44, 38, 37, 0.06);
}

.kd-char-count {
    font-size: 0.8rem;
    color: rgba(44, 38, 37, 0.4);
    font-family: var(--index-font-mono);
}

.kd-btn-search {
    background: var(--warmth-accent);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-family: var(--index-font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-organic);
}

.kd-btn-search:hover:not(:disabled) {
    background: #1e4f3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 92, 78, 0.3);
}

.kd-btn-search:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Quick categories */
.kd-quick {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

.kd-quick button {
    background: white;
    border: 1px solid rgba(44, 38, 37, 0.12);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-family: var(--index-font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--index-charcoal-80);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.kd-quick button:hover {
    border-color: var(--warmth-accent);
    color: var(--warmth-accent);
    background: rgba(42, 92, 78, 0.04);
}

/* ==========================================================================
   LOADING
   ========================================================================== */

.kd-loading {
    display: none;
    text-align: center;
    padding: 3rem 0;
}

.kd-loading.active {
    display: block;
}

.kd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(42, 92, 78, 0.15);
    border-top-color: var(--warmth-accent);
    border-radius: 50%;
    animation: kd-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

.kd-loading p {
    font-family: var(--index-font-primary);
    font-size: 1rem;
    color: var(--index-charcoal-80);
}

/* ==========================================================================
   RESULTS
   ========================================================================== */

.kd-results {
    display: none;
    margin-top: 2rem;
    text-align: left;
}

.kd-results.active {
    display: block;
}

.kd-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.kd-results-title {
    font-family: var(--index-font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--index-charcoal);
}

.kd-total-value {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-family: var(--index-font-primary);
    font-size: 0.9rem;
    color: #059669;
}

.kd-total-value strong {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Category tabs */
.kd-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 1.25rem;
}

.kd-tab {
    background: white;
    border: 1px solid rgba(44, 38, 37, 0.1);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-family: var(--index-font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--index-charcoal-80);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.kd-tab:hover {
    border-color: var(--warmth-accent);
}

.kd-tab.active {
    background: var(--warmth-accent);
    border-color: var(--warmth-accent);
    color: white;
}

.kd-tab-count {
    opacity: 0.7;
    margin-left: 3px;
}

/* Credit card */
.kd-card {
    background: white;
    border: 1px solid rgba(44, 38, 37, 0.08);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s var(--ease-organic);
    box-shadow: 0 2px 8px rgba(44, 38, 37, 0.04);
}

.kd-card:hover {
    border-color: var(--warmth-accent);
    box-shadow: 0 4px 16px rgba(42, 92, 78, 0.1);
    transform: translateY(-1px);
}

.kd-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.kd-card-name {
    font-family: var(--index-font-primary);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--index-charcoal);
}

.kd-card-value {
    font-family: var(--index-font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.kd-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.kd-card-cat {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: var(--index-font-primary);
}

.kd-cat-cloud { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.kd-cat-ai_tools { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.kd-cat-devtools { background: rgba(16, 185, 129, 0.1); color: #059669; }
.kd-cat-security { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.kd-cat-marketing { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.kd-card-diff, .kd-card-match {
    font-size: 0.8rem;
    color: rgba(44, 38, 37, 0.5);
    font-family: var(--index-font-primary);
}

.kd-match-bar {
    display: inline-block;
    width: 40px;
    height: 4px;
    background: rgba(44, 38, 37, 0.08);
    border-radius: 2px;
    margin-left: 4px;
    vertical-align: middle;
    overflow: hidden;
}

.kd-match-fill {
    display: block;
    height: 100%;
    background: var(--warmth-accent);
    border-radius: 2px;
}

.kd-card-reason {
    font-family: var(--index-font-primary);
    font-size: 0.9rem;
    color: rgba(44, 38, 37, 0.7);
    line-height: 1.5;
}

/* ==========================================================================
   SHARE GATE - Prominent unlock section
   ========================================================================== */

.kd-share-gate {
    background: linear-gradient(135deg, rgba(42, 92, 78, 0.04), rgba(42, 92, 78, 0.1));
    border: 2px dashed rgba(42, 92, 78, 0.35);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    margin: 2rem 0;
    text-align: center;
}

.kd-gate-icon {
    width: 56px;
    height: 56px;
    background: var(--warmth-accent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
}

.kd-gate-icon svg {
    stroke: white;
}

.kd-gate-title {
    font-family: var(--index-font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--index-charcoal);
    margin: 0 0 0.75rem;
    line-height: var(--index-leading-tight);
}

.kd-share-gate .kd-gate-desc {
    font-family: var(--index-font-primary);
    font-size: 0.95rem;
    color: rgba(44, 38, 37, 0.6);
    max-width: 520px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
    text-align: center;
}

.kd-gate-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.kd-gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: var(--index-font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(44, 38, 37, 0.12);
    background: white;
    color: var(--index-charcoal);
}

.kd-gate-btn:hover {
    border-color: var(--warmth-accent);
    color: var(--warmth-accent);
    background: rgba(42, 92, 78, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 92, 78, 0.12);
}

.kd-share-gate.unlocked {
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(16, 185, 129, 0.08));
    padding: 1.5rem 2rem;
}

.kd-share-gate.unlocked .kd-gate-icon {
    background: #059669;
}

.kd-share-gate.unlocked .kd-gate-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   PROMPTS SECTION
   ========================================================================== */

.kd-prompts {
    display: none;
    margin-top: 2rem;
}

.kd-prompts.active {
    display: block;
}

.kd-howto {
    margin: 1.5rem 0 2rem 0;
    padding: 1.5rem;
    background: rgba(42, 92, 78, 0.04);
    border: 1px solid rgba(42, 92, 78, 0.1);
    border-radius: 16px;
}

.kd-howto-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--warmth-accent);
    margin: 0 0 1rem 0;
    text-align: center;
}

.kd-howto-steps {
    display: flex;
    gap: 1.25rem;
}

.kd-howto-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(44, 38, 37, 0.7);
}

.kd-howto-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: var(--warmth-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .kd-howto-steps {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.kd-prompts-loading {
    text-align: center;
    padding: 2.5rem;
}

.kd-prompts-loading .kd-spinner {
    border-color: rgba(42, 92, 78, 0.15);
    border-top-color: var(--warmth-accent);
}

.kd-prompt-card {
    background: white;
    border: 1px solid rgba(44, 38, 37, 0.08);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(44, 38, 37, 0.04);
}

.kd-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.kd-prompt-header:hover {
    background: rgba(42, 92, 78, 0.02);
}

.kd-prompt-title {
    font-family: var(--index-font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--index-charcoal);
}

.kd-prompt-value {
    font-family: var(--index-font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: #059669;
}

.kd-prompt-body {
    padding: 0 1.25rem 1.25rem;
    display: none;
}

.kd-prompt-body.open {
    display: block;
}

.kd-prompt-text {
    background: var(--warmth-cream);
    border: 1px solid rgba(44, 38, 37, 0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-family: var(--index-font-primary);
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(44, 38, 37, 0.75);
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.kd-prompt-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.kd-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--warmth-accent);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-family: var(--index-font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.kd-copy-btn:hover {
    background: #1e4f3e;
}

.kd-copy-btn.copied {
    background: #059669;
}

.kd-prompt-link {
    font-family: var(--index-font-primary);
    font-size: 0.85rem;
    color: var(--warmth-primary);
    text-decoration: none;
}

.kd-prompt-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESET BUTTON
   ========================================================================== */

.kd-reset {
    text-align: center;
    margin-top: 2rem;
}

.kd-btn-reset {
    background: transparent;
    border: 1px solid rgba(44, 38, 37, 0.15);
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-family: var(--index-font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--index-charcoal-80);
    cursor: pointer;
    transition: all 0.2s;
}

.kd-btn-reset:hover {
    border-color: var(--warmth-accent);
    color: var(--warmth-accent);
}

/* ==========================================================================
   ERROR
   ========================================================================== */

.kd-error {
    display: none;
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 16px;
    margin-top: 1.5rem;
}

.kd-error.active {
    display: block;
}

.kd-error p {
    color: #dc2626;
    font-family: var(--index-font-primary);
    font-size: 0.9rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .kd-hero h1 {
        font-size: 2rem;
    }

    .kd-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kd-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

}
