/* ================================================
   AUTH & PANEL STYLES
   Strony: logowanie, aktywacja, reset hasła, panel
   ================================================ */

/* === AUTH LAYOUT === */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--section-padding) + 60px) 1.5rem var(--section-padding);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* === FORMS === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.field-error {
    font-size: 0.8125rem;
    color: var(--error);
    display: none;
}

/* === MESSAGES === */
.form-error-message,
.form-success-message {
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    display: none;
}

.form-error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.form-success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* === PASSWORD STRENGTH === */
.password-requirements {
    background: var(--bg-elevated);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.password-requirements h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.password-requirements ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.password-requirements li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements li::before {
    content: '○';
    color: var(--text-muted);
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid::before {
    content: '✓';
    color: var(--success);
}

/* === AUTH LINKS === */
.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-links a {
    color: var(--primary-light);
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

/* === AUTH LOADING === */
.auth-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ================================================
   PANEL STYLES
   ================================================ */

/* === PANEL LAYOUT === */
.panel-page {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.panel-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.panel-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.panel-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-nav a {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.panel-nav a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.panel-nav a.active {
    background: var(--primary-glow);
    color: var(--primary-light);
}

.panel-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.panel-user-info {
    text-align: right;
}

.panel-user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.panel-user-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.panel-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5;
}

/* === PANEL MAIN === */
.panel-main {
    padding: 2rem 0;
}

.panel-title {
    margin-bottom: 2rem;
}

.panel-title h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.panel-title p {
    color: var(--text-muted);
}

/* === PANEL CARDS === */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.2s;
}

.panel-card:hover {
    border-color: var(--border-hover);
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.panel-card-icon {
    font-size: 1.25rem;
}

.panel-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.panel-card-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* === SUBSCRIPTION STATUS === */
.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.subscription-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.subscription-badge.cancelling {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.subscription-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* === PANEL SECTIONS === */
.panel-section {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.panel-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-section-title .icon {
    font-size: 1.25rem;
}

/* === PACKAGES LIST === */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.package-card {
    background: var(--bg-elevated);
    border: 2px solid var(--border-default);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.2s;
    position: relative;
}

.package-card:hover {
    border-color: var(--border-hover);
}

.package-card.current {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.package-card.current::after {
    content: 'Obecny';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.package-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.package-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}

.package-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.package-workers {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.package-features {
    margin-bottom: 1.5rem;
}

.package-features li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.375rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.package-features li::before {
    content: '✓';
    color: var(--success);
}

/* === INVOICES TABLE === */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th,
.invoices-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-default);
}

.invoices-table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invoices-table td {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.invoices-table tbody tr:hover {
    background: var(--bg-elevated);
}

.invoice-number {
    font-weight: 500;
    color: var(--text-primary);
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.invoice-status.paid {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.invoice-status.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

/* === PENDING CHANGES === */
.pending-change {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pending-change-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pending-change-icon {
    font-size: 1.25rem;
}

.pending-change-text {
    font-size: 0.9375rem;
    color: #fbbf24;
}

.pending-change-cancel {
    background: transparent;
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pending-change-cancel:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* === DANGER ZONE === */
.danger-zone {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: #fca5a5;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.danger-zone p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.danger-zone .btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.danger-zone .btn-danger:hover {
    background: var(--error);
    color: white;
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 1rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-default);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
    }

    .panel-header .container {
        flex-wrap: wrap;
    }

    .panel-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border-default);
    }

    .panel-user {
        flex: 1;
    }

    .panel-user-info {
        display: none;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

    .invoices-table {
        display: block;
        overflow-x: auto;
    }
}
