/* Frontend styles for footer actions and flow templates. */

/* Footer bar wrapper */
.ck-footer-bar {
    box-sizing: border-box;
    width: 100%;
    position: relative;
    z-index: 100;
    background: #ffffff;
    border-top: 2px solid #e1e4e8;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
}

.ck-footer-actions {
    /* Keep visible even when theme CSS is aggressive. */
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: stretch;
    min-height: 44px;
    margin: 1.25rem auto;
    padding: 0.5rem 1.25rem;
    box-sizing: border-box;
}

/* Clear separation of withdrawal and cancellation flows in the footer */
.ck-flow-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #d8dbe0;
    border-radius: 10px;
    background: #ffffff;
}

.ck-flow-group--withdrawal {
    border-color: #c8d9fb;
    background: #f8fbff;
}

.ck-flow-group--cancellation {
    border-color: #d8dbe0;
    background: #fafafa;
}

.ck-flow-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5568;
}

/* Action items (always links, styled as link or button) */
.ck-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.55rem 1rem;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
}

.ck-action-link {
    color: #0b57d0;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding-left: 0;
    padding-right: 0;
}

.ck-action-button {
    background: #0b57d0;
    color: #ffffff;
    border: 2px solid transparent;
    border-radius: 999px;
}

/* Keep cancellation visually distinct */
.ck-item--cancellation.ck-action-button {
    background: transparent;
    color: #0b57d0;
    border-color: #0b57d0;
}

.ck-item--cancellation.ck-action-link {
    color: #555555;
}

/* Focus styles */
.ck-action:focus-visible,
.ck-submit:focus-visible {
    outline: 3px solid #0b57d0;
    outline-offset: 3px;
}

.ck-action-button:focus-visible {
    outline-color: #003d99;
}

/* Hover and active */
@media (hover: hover) {
    .ck-action-button:hover {
        filter: brightness(0.88);
    }

    .ck-action-link:hover {
        text-decoration-thickness: 2px;
    }
}

.ck-action:active {
    opacity: 0.82;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .ck-action,
    .ck-submit {
        transition: none !important;
    }

    .ck-action-button:hover {
        filter: none !important;
    }
}

/* Form field focus and validation states */
.ck-form input:focus-visible,
.ck-form textarea:focus-visible {
    outline: 3px solid #0b57d0;
    outline-offset: 1px;
    border-color: #0b57d0;
    box-shadow: 0 0 0 1px #0b57d0;
}

.ck-form input[aria-invalid="true"],
.ck-form textarea[aria-invalid="true"] {
    border-color: #cc2936;
    border-width: 2px;
}

.ck-form input[aria-invalid="true"]:focus-visible,
.ck-form textarea[aria-invalid="true"]:focus-visible {
    outline-color: #a01520;
    box-shadow: 0 0 0 1px #a01520;
    border-color: #a01520;
}

/* Inline per-field error labels */
.ck-field-error {
    display: block;
    color: #b42318;
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: -0.1rem;
}

/* Error summary heading */
.ck-error-heading {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
}

/* Flow pages (withdrawal and cancellation templates) */
.ck-flow-page {
    background: #f5f6f7;
}

.ck-flow {
    max-width: 720px;
    margin: 2rem auto;
    background: #ffffff;
    border: 1px solid #d8dbe0;
    border-radius: 10px;
    padding: 1.25rem;
    box-sizing: border-box;
}

.ck-flow h1 {
    margin-top: 0;
}

.ck-step-label {
    display: inline-block;
    margin: 0 0 0.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e7eefc;
    color: #173a7a;
    font-size: 0.85rem;
    font-weight: 700;
}

.ck-form {
    display: grid;
    gap: 0.65rem;
}

.ck-form input,
.ck-form textarea,
.ck-submit {
    font: inherit;
}

.ck-form input,
.ck-form textarea {
    width: 100%;
    border: 1px solid #b8bec6;
    border-radius: 6px;
    padding: 0.6rem;
    box-sizing: border-box;
}

.ck-help-text {
    margin: -0.2rem 0 0.25rem;
    color: #555555;
    font-size: 0.92rem;
}

.ck-submit {
    width: max-content;
    min-width: 220px;
    border: 0;
    border-radius: 8px;
    background: #1f7a3f;
    color: #ffffff;
    padding: 0.7rem 1rem;
    cursor: pointer;
}

.ck-error {
    border-left: 4px solid #cc2936;
    background: #fff3f3;
    color: #1a1a1a;
    padding: 0.75rem;
}

.ck-error p {
    margin: 0.1rem 0;
}

/* Success confirmation */
.ck-success-message {
    padding: 0.85rem 1rem;
    background: #edf7f1;
    border-left: 4px solid #1f7a3f;
    border-radius: 4px;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
}

.ck-success-message p {
    margin: 0.2rem 0;
}

.ck-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Mobile: stack actions, keep large touch targets */
@media (max-width: 480px) {
    .ck-footer-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        padding: 0.75rem 1rem;
    }

    .ck-flow-group {
        width: 100%;
        align-items: stretch;
    }

    .ck-action {
        justify-content: center;
        width: 100%;
    }

    .ck-action-link {
        padding: 0.55rem 0;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .ck-flow {
        margin: 1rem;
        padding: 1rem;
    }

    .ck-submit {
        width: 100%;
    }
}
