/* =========================================
   PJM AUTH FORMS (Unified Design)
   ========================================= */

:root {
    --pjm-orange: #1B5E4B;
    --pjm-orange-hover: #154A3B;
    --pjm-dark: #16241D;
    --pjm-gray: #95a5a6;
    --pjm-border: #e0e0e0;
    --pjm-bg: #fdfdfd;
    --radius: 12px;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

/* KONTENER */
.pjm-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    min-height: 600px;
}

.pjm-auth-card {
    background: #fff;
    width: 100%;
    max-width: 480px;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

/* NAGŁÓWKI */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--pjm-dark);
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 15px;
    color: var(--pjm-gray);
    margin: 0;
    line-height: 1.5;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bbb;
    margin: 25px 0 15px 0;
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

/* INPUTY (FLOATING LABELS) */
.pjm-input-group {
    position: relative;
    margin-bottom: 20px;
}

.pjm-input-group input {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid var(--pjm-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--pjm-dark);
    background: #fff;
    outline: none;
    transition: 0.3s ease;
    height: 52px;
    box-sizing: border-box;
}

.pjm-input-group input:focus {
    border-color: var(--pjm-orange);
    box-shadow: 0 4px 12px rgba(27, 94, 75, 0.1);
}

.pjm-input-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
    transition: 0.2s ease;
    background: transparent;
    padding: 0 4px;
}

/* Animacja etykiety */
.pjm-input-group input:focus~label,
.pjm-input-group input:not(:placeholder-shown)~label {
    top: 0;
    left: 12px;
    font-size: 11px;
    background: #fff;
    color: var(--pjm-orange);
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

/* INPUT Z IKONĄ */
.pjm-input-group.icon-group input {
    padding-left: 48px;
}

.pjm-input-group.icon-group .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #bdc3c7;
    transition: 0.3s;
    z-index: 1;
}

.pjm-input-group.icon-group input:focus~.icon {
    color: var(--pjm-orange);
}

.pjm-input-group.icon-group label {
    left: 48px;
}

.pjm-input-group.icon-group input:focus~label,
.pjm-input-group.icon-group input:not(:placeholder-shown)~label {
    left: 12px;
    /* Powrót do standardu po uniesieniu */
}

/* PRZYCISK SUBMIT */
.pjm-btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--pjm-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    margin-top: 25px;
}

.pjm-btn-submit:hover {
    background: var(--pjm-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 94, 75, 0.3);
}

.pjm-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* PRZEŁĄCZNIK ROLE (OSOBA/FIRMA) */
.pjm-role-switcher {
    display: flex;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 50px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.switch-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #7f8c8d;
    z-index: 2;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.switch-btn input {
    display: none;
}

.switch-btn.active {
    color: #fff;
}

.switch-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--pjm-orange);
    border-radius: 40px;
    transition: transform 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(27, 94, 75, 0.2);
}

.switch-btn:nth-child(2).active~.switch-slider {
    transform: translateX(100%);
}

/* LINKI I FOOTER */
.auth-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -10px;
    margin-bottom: 20px;
}

.auth-link {
    color: var(--pjm-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    color: var(--pjm-gray);
    font-size: 14px;
}

/* UTILITIES */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mt-4 {
    margin-top: 20px;
}

/* OTP INPUT */
.otp-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.otp-container input {
    width: 100%;
    max-width: 200px;
    height: 50px;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    border: 2px solid var(--pjm-border);
    border-radius: 8px;
    outline: none;
}

.otp-container input:focus {
    border-color: var(--pjm-orange);
}

/* WALIDATOR HASŁA */
.pjm-password-validator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #eee;
}

.validator-item {
    font-size: 12px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.validator-item.valid {
    color: #27ae60;
}

/* MESSAGES */
.pjm-auth-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
    display: none;
}

.pjm-auth-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.pjm-auth-message.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* RESPONSYWNOŚĆ */
@media (max-width: 500px) {
    .pjm-auth-card {
        padding: 25px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-header h1 {
        font-size: 22px;
    }
}