/* =====================
   Styl formularzy modalnych (login, rejestracja, konto)
   ===================== */

.content-blur {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Kontener formularza */
.modal {
    background: white;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 85%;
    margin: 2em auto;
    position: relative;
    animation: fadeInUp 0.4s ease;
	max-width: 700px;
}

/* Nagłówek formularza z przyciskiem zamknięcia */
#notifications, #email {
    scroll-margin-top: 100px;
}

#notifications fieldset {
    margin: 12px 0;
    padding: 12px 16px;
    border: 1px solid #d9dce1;
    border-radius: 9px;
}

#notifications legend {
    padding: 0 6px;
    font-weight: 600;
}

#notifications .checkbox-inline {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
}

#notifications input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: #ed712c;
}

.form-header {
    position: relative;
    padding-right: 1.5em;
}

.form-header .close-button {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.form-error {
    margin: 1em 0;
    padding: 0.75em 0.9em;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: bold;
    line-height: 1.4;
}


/* Formularze: etykiety i pola */
label {
    display: block;
    margin-top: 0.5em;
    font-size: 0.95em;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	padding:		0.68em 0.75em;
	width:			100%;
	margin-top:		0.2em;
	border:         1px solid #d9dce1;
	border-radius:  9px;
	background:     #ffffff;
	color:          #24272c;
	box-sizing:		border-box;
	font-size:		1em;
	font-family:    inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
	border-color: #ff8b4d;
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 139, 77, .16);
}

input:not([type="checkbox"]):not([type="radio"]):disabled,
select:disabled,
textarea:disabled {
	background: #f3f4f5;
	color: #73777d;
}

textarea {
	resize: vertical;
}


.modal > form > button[type="submit"] {
    margin-top: 1em;
}

.form-actions {
    margin-top: 1em;
}

.form-section h2,
.modal > form h2,
.modal > section h2 {
	margin-bottom: .7rem;
	font-size: 1.15rem;
	font-weight: 600;
}


/* Hasła z ikonką widoczności */
.password-wrapper {
    position: relative;
    margin-top: 0.2em;
}

.password-wrapper input {
    padding-right: 2.5em;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.5em;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
    user-select: none;
}

/* Checkbox w jednej linii */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    white-space: nowrap;
    font-size: 0.95em;
    margin-top: 0.5em;
}

.account-contact-visibility {
    display: grid;
    gap: 0.25em;
    margin-top: 0.75em;
}

.account-contact-visibility .checkbox-inline {
    white-space: normal;
}

/* Avatar w panelu konta */
img.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1em;
}

.content-blur.is-blurred {
    filter: blur(3px) saturate(.9);
    transform: translateZ(0);
}

.body-has-photo-modal {
    overflow: hidden;
}

.account-photo-section {
    margin: 1.5em 0;
}

.account-photo-section h2 {
    margin-top: 0;
    margin-bottom: 0.75em;
}

.account-photo-row {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.account-photo-row .avatar-preview {
    margin-bottom: 0;
}

.account-photo-change-btn,
.photo-secondary-btn {
    padding: 0.6em 1em;
    border: 1px solid #e0d8d1;
    border-radius: 6px;
    background: #ffffff;
    color: #333333;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
}

.account-photo-change-btn:hover,
.photo-secondary-btn:hover {
    background: #f7f2ee;
}

.photo-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    background: rgba(15, 18, 23, 0.36);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.photo-modal-backdrop[hidden] {
    display: none;
}

.photo-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.photo-modal-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 2em);
    overflow: auto;
    padding: 1.5em;
    border: 1px solid #e8e2dd;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    transform: translateY(8px) scale(.98);
    transition: transform 0.15s ease;
}

.photo-modal-backdrop.is-open .photo-modal-panel {
    transform: translateY(0) scale(1);
}

.photo-modal-panel h2 {
    margin: 0 2em 1em 0;
}

.photo-modal-close {
    position: absolute;
    top: 0.8em;
    right: 0.8em;
    width: 36px;
    height: 36px;
    border: 1px solid #e6e0da;
    border-radius: 50%;
    background: #ffffff;
    color: #333333;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
}

.photo-modal-close:hover {
    background: #f7f2ee;
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1em;
    margin-bottom: 1em;
}

.photo-preview-item {
    display: grid;
    justify-items: center;
    gap: 0.5em;
    padding: 0.8em;
    border: 1px solid #eee7e1;
    border-radius: 8px;
    background: #fffdfb;
}

.photo-preview-item .avatar-preview {
    width: 112px;
    height: 112px;
    margin-bottom: 0;
}

.photo-preview-label {
    color: #5f5852;
    font-size: 0.9em;
    font-weight: bold;
}

#photoInput {
    padding: 0.6em;
    border: 1px solid #e0d8d1;
    border-radius: 6px;
    background: #ffffff;
}

#photoInput::file-selector-button {
    margin-right: 0.8em;
    padding: 0.45em 0.8em;
    border: 1px solid #e0d8d1;
    border-radius: 6px;
    background: #f7f2ee;
    color: #333333;
    font-weight: bold;
    cursor: pointer;
}

.photo-file-info {
    min-height: 1.2em;
    margin: 0.5em 0 0;
}

.photo-file-info,
.form-hint {
    color: #5f5852;
    font-size: 0.92em;
    line-height: 1.5;
}

.photo-modal-message {
    min-height: 1.2em;
    margin: 0.4em 0 0;
    color: #5f5852;
    font-size: 0.92em;
    font-weight: bold;
}

.photo-modal-message.is-error {
    color: #b42318;
}

.photo-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
    margin-top: 1.2em;
}

.photo-modal-actions button {
    width: auto;
}

.photo-modal-actions #photoSubmitButton[type="submit"] {
    width: auto;
}

.photo-modal-actions #photoSubmitButton[type="submit"]:disabled {
    background: #d8d8d8;
    color: #666666;
    cursor: not-allowed;
}

.photo-modal-actions #photoSubmitButton[type="submit"]:disabled:hover {
    background: #d8d8d8;
}

.account-danger-zone {
    padding-top: 1rem;
    border-top: 1px solid #ece7e3;
}

.account-danger-zone p {
    margin: 0 0 0.8rem;
    color: #5f5852;
}

.account-delete-trigger {
    padding: 0.5rem 0.75rem;
    border: 1px solid #c63b45;
    border-radius: 7px;
    background: #fff;
    color: #a12626;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-delete-trigger:hover {
    background: #fff3f3;
}

.account-delete-dialog {
    box-sizing: border-box;
    width: min(500px, calc(100vw - 2rem));
    padding: 1.25rem;
    border: 1px solid #e1e3e7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
    color: #2f3338;
}

.account-delete-dialog::backdrop {
    background: rgba(15, 18, 23, 0.38);
    backdrop-filter: blur(2px);
}

.account-delete-dialog form {
    margin: 0;
}

.account-delete-dialog h2 {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
}

.account-delete-dialog p,
.account-delete-dialog ul {
    color: #555b64;
    line-height: 1.5;
}

.account-delete-dialog ul {
    padding-left: 1.25rem;
}

.account-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}

.account-delete-actions button {
    width: auto;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-delete-cancel {
    border: 1px solid #d5d8dc;
    background: #fff;
    color: #444a52;
}

.account-delete-actions .account-delete-confirm {
    border: 1px solid #b4232d;
    background: #b4232d;
    color: #fff;
}

.account-delete-actions .account-delete-confirm:hover {
    background: #991b24;
}

/* Animacja wjazdu formularza */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================
   RWD
   ===================== */
@media (max-width: 500px) {
    .modal {
        width: 85%;
        padding: 1em;
    }

    .form-header .close-button {
        font-size: 1.2em;
        top: 0.2em;
        right: 0.2em;
    }

    .photo-preview-grid {
        grid-template-columns: 1fr;
    }

    .photo-modal-panel {
        padding: 1em;
    }

    .photo-modal-actions {
        flex-direction: column-reverse;
    }

    .photo-modal-actions button {
        width: 100%;
    }

    .photo-modal-actions #photoSubmitButton[type="submit"] {
        width: 100%;
    }
	
}

.ad-card {
    background: #fff;
    padding: 1em;
    margin: 1em 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.action-buttons {
    margin-top: 1em;
    display: flex;
    gap: 1em;
}

.edit-btn {
    background-color: #ff8b4d;
    color: white;
    padding: 0.5em 1em;
    border-radius: 4px;
    text-decoration: none;
}

.delete-btn {
    background: #ffdddd;
    border: 1px solid #cc0000;
    border-radius: 4px;
    padding: 0.5em 1em;
    font-weight: bold;
    cursor: pointer;
}

.contact-btn {
    margin-top: 1em;
    padding: 0.6em 1em;
    width: 100%;
    background-color: #ff8b4d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

.info-label {
    font-weight: bold;
    margin-top: 1em;
}

