/* Wypożyczalnia Książek — Frontend Styles (mobile-first) */

/* =============================================
   Formularz wypożyczenia
   ============================================= */

.wk-form-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
}

.wk-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.wk-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95em;
    color: #4478CC;
}

.wk-required {
    color: #c0392b;
}

.wk-form input[type="text"],
.wk-form input[type="tel"],
.wk-form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px; /* 16px = brak zoom na iOS */
    color: #222;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.wk-form input::placeholder {
    color: #999;
}

.wk-form input:focus {
    border-color: #4478CC;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Autocomplete dropdown */
.wk-input-wrap {
    position: relative;
}

.wk-ac-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wk-ac-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.12s;
}

.wk-ac-item:last-child {
    border-bottom: none;
}

.wk-ac-item:hover,
.wk-ac-item.wk-ac-active {
    background-color: #edf2f7;
}

.wk-ac-title {
    display: block;
    font-weight: 600;
    color: #4478CC;
    font-size: 0.95em;
    line-height: 1.3;
}

.wk-ac-author {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-top: 2px;
}

.wk-ac-empty {
    padding: 16px 14px;
    color: #999;
    font-size: 0.9em;
    text-align: center;
}

/* Checkbox RODO */
.wk-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 0.85em;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
}

.wk-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Przycisk */
.wk-btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: #4478CC;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    -webkit-appearance: none;
}

.wk-btn:hover {
    background-color: #3460a8;
}

.wk-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wk-btn-submit {
    width: 100%;
}

/* Błędy pól */
.wk-field-error {
    display: none;
    margin-top: 6px;
    font-size: 0.85em;
    color: #c0392b;
}

/* Komunikaty sukcesu/błędu */
.wk-form-message {
    margin-top: 8px;
}

.wk-msg-success {
    padding: 20px;
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 1em;
    line-height: 1.5;
    text-align: center;
}

.wk-msg-error {
    padding: 16px;
    background-color: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    color: #c62828;
    font-size: 0.95em;
    text-align: center;
}

/* =============================================
   Shortcode [wypozyczalnia_status]
   ============================================= */

.wk-status-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
}

.wk-status-form h3 {
    margin: 0 0 8px;
    font-size: 1.2em;
    color: #4478CC;
}

.wk-status-form p {
    margin: 0 0 16px;
    color: #666;
    font-size: 0.9em;
}

.wk-form-field {
    margin-bottom: 12px;
}

.wk-form-field input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    color: #222;
    box-sizing: border-box;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.wk-form-field input[type="text"]:focus {
    border-color: #4478CC;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Wyniki statusu */
.wk-status-results {
    margin-top: 24px;
}

.wk-status-results h4 {
    margin: 0 0 12px;
    color: #4478CC;
    font-size: 1.1em;
}

.wk-no-results {
    padding: 16px;
    background-color: #f8f8f8;
    border-radius: 8px;
    color: #666;
    text-align: center;
    font-size: 0.95em;
}

.wk-borrowings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wk-borrowing-item {
    padding: 14px 16px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.wk-borrowing-title {
    font-weight: 600;
    color: #4478CC;
    flex: 1 1 100%;
    font-size: 0.95em;
}

.wk-borrowing-due {
    font-size: 0.85em;
    color: #555;
}

.wk-borrowing-status {
    font-size: 0.8em;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: auto;
}

.wk-status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.wk-status-overdue {
    background-color: #ffebee;
    color: #c62828;
}

/* =============================================
   Spinner
   ============================================= */

.wk-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wk-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

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

/* =============================================
   Tablet+ (>= 600px)
   ============================================= */

@media (min-width: 600px) {
    .wk-form-wrapper,
    .wk-status-wrapper {
        padding: 24px 0;
    }

    .wk-btn-submit {
        width: auto;
    }
}
