/* Apresia — Frontend Styles */

/* ── Form container ──────────────────────────────────────────────── */
.apresia-form {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
}

/* ── Header kreator ──────────────────────────────────────────────── */
.apresia-form__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.apresia-form__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.apresia-form__kreator-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 .25rem;
}

.apresia-form__bio {
    font-size: .875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ── Goal bar ────────────────────────────────────────────────────── */
.apresia-goal {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .875rem 1rem;
    margin-bottom: 1.25rem;
}

.apresia-goal__label {
    display: flex;
    justify-content: space-between;
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: .5rem;
    color: #374151;
}

.apresia-goal__bar {
    background: #e5e7eb;
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    margin-bottom: .4rem;
}

.apresia-goal__fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 99px;
    transition: width .4s ease;
}

.apresia-goal__nums {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: #9ca3af;
}

/* ── Form elements ───────────────────────────────────────────────── */
.apresia-form__group {
    margin-bottom: 1rem;
}

.apresia-form__label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: .375rem;
}

.apresia-input {
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .9375rem;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s;
}

.apresia-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

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

.apresia-charcount {
    font-size: .75rem;
    color: #9ca3af;
    text-align: right;
    margin-top: .25rem;
}

/* ── Preset buttons ──────────────────────────────────────────────── */
.apresia-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .5rem;
}

.apresia-preset {
    padding: .4rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: .8125rem;
    cursor: pointer;
    color: #374151;
    transition: all .15s;
}

.apresia-preset:hover,
.apresia-preset.active {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #7c3aed;
}

/* ── Komisi breakdown ────────────────────────────────────────────── */
.apresia-breakdown {
    display: flex;
    gap: 1.25rem;
    margin-top: .5rem;
    font-size: .8rem;
    color: #6b7280;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 6px;
    padding: .5rem .75rem;
}

.apresia-breakdown strong {
    color: #374151;
}

/* ── Checkbox ────────────────────────────────────────────────────── */
.apresia-form__checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: #374151;
    margin-top: .4rem;
    cursor: pointer;
}

/* ── Primary button ──────────────────────────────────────────────── */
.apresia-btn--primary {
    width: 100%;
    padding: .75rem;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    margin-top: .25rem;
}

.apresia-btn--primary:hover  { background: #6d28d9; }
.apresia-btn--primary:active { transform: scale(.98); }

/* ── Disclaimer ──────────────────────────────────────────────────── */
.apresia-disclaimer {
    font-size: .75rem;
    color: #9ca3af;
    text-align: center;
    margin-top: .625rem;
    line-height: 1.5;
}

/* ── Loading overlay ─────────────────────────────────────────────── */
.apresia-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 99;
}

.apresia-overlay__content {
    text-align: center;
    font-size: .9375rem;
    color: #374151;
}

.apresia-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: apresia-spin .7s linear infinite;
    margin: 0 auto .75rem;
}

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

/* ── Riwayat donasi ──────────────────────────────────────────────── */
.apresia-riwayat__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    padding: .625rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: .9rem;
}

.apresia-riwayat__nama   { font-weight: 500; }
.apresia-riwayat__amount { color: #7c3aed; font-weight: 600; margin-left: auto; }
.apresia-riwayat__pesan  { width: 100%; font-size: .8125rem; color: #6b7280; margin: 0; }

/* ── Share buttons (Apresia v1.2) ─────────────────────────────────── */
.apresia-share-section {
    margin: 1.25rem 0;
}

.apresia-share-label {
    font-size: .8125rem;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    margin-bottom: .625rem;
}

.apresia-share-buttons {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.apresia-share-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .15s;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.apresia-share-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.apresia-share-btn--wa {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}
.apresia-share-btn--wa:hover { background: #1ebe5d; border-color: #1ebe5d; }

.apresia-share-btn--x {
    background: #000;
    color: #fff;
    border-color: #000;
}
.apresia-share-btn--x:hover { background: #333; border-color: #333; }

.apresia-share-btn--copy {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.apresia-share-btn--copy:hover { border-color: #7c3aed; color: #7c3aed; }

/* Ekosistem info box */
.apresia-ekosistem-info {
    display: flex;
    gap: .625rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .8rem;
    color: #0c4a6e;
    margin: .75rem 0;
    line-height: 1.55;
}
.apresia-ekosistem-info__icon { flex-shrink: 0; font-size: 1rem; }

.apresia-ekosistem-note {
    font-size: .8125rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    padding: .6rem .875rem;
    margin-top: .75rem;
    line-height: 1.55;
}

/* Breakdown row update */
.apresia-breakdown {
    flex-direction: column;
    gap: .25rem;
}
.apresia-breakdown__row {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .8rem;
    color: #6b7280;
}
.apresia-breakdown__row strong { color: #374151; }

/* Share section success state */
.apresia-share-section--success {
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}
