/* =========================================================
   FORMS.CSS — wspólna baza formularzy
========================================================= */

.tm-form,
.tm-form *,
.tm-form *::before,
.tm-form *::after {
    box-sizing: border-box;
}

.tm-form {
    width: 100%;
}

.tm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tm-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.tm-field.is-full {
    grid-column: 1 / -1;
}

.tm-field label {
    color: #d7d7d7;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.tm-input,
.tm-select,
.tm-textarea {
    width: 100%;
    margin: 0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: 14px;
}

.tm-input,
.tm-select {
    min-height: 44px;
    padding: 0 13px;
}

.tm-textarea {
    min-height: 120px;
    padding: 12px 13px;
    line-height: 1.6;
    resize: vertical;
}

.tm-input:focus,
.tm-select:focus,
.tm-textarea:focus {
    border-color: #39ff14;
    outline: 2px solid rgba(57, 255, 20, 0.14);
    outline-offset: 1px;
}

.tm-input::placeholder,
.tm-textarea::placeholder {
    color: #777;
}

.tm-select option,
.tm-select optgroup {
    background: #1b1b1b;
    color: #fff;
}

.tm-help {
    margin: 0;
    color: #888;
    font-size: 12px;
    line-height: 1.6;
}

.tm-error-text {
    color: #ff6969;
}

.tm-success-text {
    color: #6dff52;
}

@media (max-width: 720px) {
    .tm-form-grid {
        grid-template-columns: 1fr;
    }

    .tm-field.is-full {
        grid-column: auto;
    }
}


.tm-select {
    padding-right: 42px;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25l5-5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}


/* V24 — zgodność ze starszą klasą tekstu pomocniczego */
.help-text {
    margin: 8px 0 10px;
    padding: 9px 11px;
    border: 1px solid #333;
    border-radius: 7px;
    background: #151515;
    color: #999;
    font-size: 12px;
    font-style: normal;
    line-height: 1.55;
    text-align: center;
}

.help-text > i {
    margin-right: 5px !important;
    color: #39ff14 !important;
}


/* =========================================================
   V25 — zgodność ze starszymi formularzami
========================================================= */

.container label {
    display: block;
    margin-top: 15px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 700;
}

.container input[type="text"],
.container input[type="email"],
.container input[type="password"],
.container input[type="date"],
.container input[type="time"],
.container input[type="number"],
.container select,
.container textarea {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
    font-size: 14px;
}

.container input[type="file"] {
    width: 100%;
    margin-top: 5px;
    padding: 7px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font: inherit;
    font-size: 14px;
}

.container input:focus,
.container select:focus,
.container textarea:focus {
    border-color: #39ff14;
    outline: 2px solid rgba(57, 255, 20, 0.14);
    outline-offset: 1px;
}

/* --- IDEALNE WYŚRODKOWANIE OKA W HAŚLE --- */
.password-container {
    position: relative;
    display: flex;
    width: 100%; /* Wymuszamy pełną szerokość */
    align-items: center;
    margin-bottom: 15px;
}

.password-container input {
    width: 100%;
    padding-right: 40px !important; /* KLUCZOWE: Robi miejsce na oko, żeby tekst pod nie nie właził */
    box-sizing: border-box; /* Utrzymuje input w ryzach ramki */
    margin-bottom: 0 !important; 
    margin-top: 0 !important;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%); /* Wymusza idealny środek matematyczny */
    width: 30px;
    height: 30px; /* Zamiast 100%, dajemy stałą wysokość strefy kliknięcia */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.toggle-password i {
    margin: 0 !important; 
    padding: 0 !important;
    color: #888 !important;
    transition: 0.2s ease-in-out;
    font-size: 16px;
    display: block;
    line-height: 1; /* KLUCZ: Zabija domyślne pionowe odstępy czcionki, przez które ikona wydaje się przesunięta */
}

/* Neonowy błysk przy najechaniu myszką */
.toggle-password:hover i {
    color: #39ff14 !important; 
}


/* =========================================
   POLA TEKSTOWE (LOGOWANIE / REJESTRACJA)
========================================= */
body:not(.seo-home):not(.dashboard-page) input[type="text"],
body:not(.seo-home):not(.dashboard-page) input[type="password"],
body:not(.seo-home):not(.dashboard-page) input[type="email"] {
    background-color: #ffffff !important; 
    color: #121212 !important; 
    border: 1px solid #ccc !important; 
    font-weight: bold; 
}

body:not(.seo-home):not(.dashboard-page) input[type="text"]:focus,
body:not(.seo-home):not(.dashboard-page) input[type="password"]:focus,
body:not(.seo-home):not(.dashboard-page) input[type="email"]:focus {
    background-color: #ffffff !important;
    border-color: #39ff14 !important; 
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3) !important;
    outline: none;
}

body:not(.seo-home):not(.dashboard-page) input::placeholder {
    color: #888888 !important;
}



/* Nowe formularze tm-* zawsze zachowują ciemny wygląd. */
.tm-form .tm-input,
.tm-form .tm-select,
.tm-form .tm-textarea {
    background: #111 !important;
    color: #fff !important;
    border-color: #3a3a3a !important;
    font-weight: 400;
}

.tm-form .tm-input:focus,
.tm-form .tm-select:focus,
.tm-form .tm-textarea:focus {
    background: #111 !important;
    border-color: #39ff14 !important;
    box-shadow: none !important;
}


/* =========================================
   18. FORMULARZE - STYLE DLA SELECTÓW
   ========================================= */
select { 
    width: 100%; 
    padding: 12px; 
    background: #1e1e1e; 
    color: #fff; 
    border: 1px solid #444; 
    border-radius: 4px; 
    box-sizing: border-box; 
}
option { 
    background: #1e1e1e; 
    color: #fff; 
}
optgroup { 
    color: #ccc; 
    font-style: normal; 
    font-weight: bold; 
}


/* =========================================
   19. PANCERNY GRID DLA FORMULARZY (DATY/WYNIKI)
   ========================================= */
.grid-responsive {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}
.grid-responsive input {
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
}
@media (max-width: 768px) {
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}


/* =========================================================
   V20 — równy odstęp dla strzałki we wszystkich selectach
========================================================= */
body:not(.seo-home) select {
    padding-right: 42px !important;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25l5-5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 12px 8px !important;
}

body:not(.seo-home) select:disabled {
    opacity: 0.65;
}


/* V26 — wspólny wygląd opcji i grup w selectach */
body:not(.seo-home) select option {
    background: #1e1e1e;
    color: #fff;
}

body:not(.seo-home) select optgroup {
    background: #1e1e1e;
    color: #ccc;
    font-style: normal;
    font-weight: 800;
}
