/* KsięgoPlus - Auth Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a8a 100%);
    min-height: 100vh;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 520px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
}

.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #94a3b8;
    font-size: 15px;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
}

.form-group label .optional {
    color: #64748b;
    font-weight: 400;
}

.form-row {
    display: flex;
    gap: 12px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.input-wrapper svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 15px;
    padding: 12px 0;
}

.input-wrapper input::placeholder {
    color: #475569;
}

.toggle-password {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #94a3b8;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Form separator */
.form-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.form-separator span {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Plan selector */
.plan-selector {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.plan-option {
    flex: 1;
    cursor: pointer;
    display: flex;
}

/* Free plan - narrow strip */
.plan-option:first-child {
    flex: 0 0 80px;
}

.plan-option:first-child .plan-card {
    padding: 8px 4px;
}

.plan-option:first-child .plan-name {
    font-size: 11px;
}

.plan-option:first-child .plan-price {
    font-size: 14px;
}

.plan-option:first-child .plan-desc {
    font-size: 9px;
}

/* Professional plan - recommended badge */
.plan-option:nth-child(3) .plan-card {
    position: relative;
    border-color: rgba(245, 158, 11, 0.3);
}

.plan-option:nth-child(3) .plan-card::before {
    content: 'Polecany';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}

.plan-option input[type="radio"] {
    display: none;
}

.plan-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
    height: 100%;
    width: 100%;
}

.plan-option input:checked + .plan-card {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.plan-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.plan-price {
    font-size: 18px;
    font-weight: 700;
    color: #f59e0b;
}

.plan-price small {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
}

.plan-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

/* Compare plans button */
.btn-compare-plans {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.btn-compare-plans:hover {
    color: #f59e0b;
}

.btn-compare-plans svg {
    width: 14px;
    height: 14px;
}

/* Compare plans modal */
.compare-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s;
}

.compare-overlay.open {
    opacity: 1;
}

.compare-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}

.compare-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.compare-close:hover {
    color: white;
}

.compare-table-wrap {
    overflow-x: auto;
    padding: 12px 20px 20px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.compare-table th,
.compare-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.compare-table th {
    color: #f59e0b;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
}

.compare-table td:first-child,
.compare-table th:first-child {
    text-align: left;
    color: #e2e8f0;
    font-weight: 500;
}

.compare-table td {
    color: #94a3b8;
}

.compare-check {
    color: #4ade80;
    font-weight: 700;
}

.compare-cross {
    color: #475569;
}

/* Error */
.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fca5a5;
    font-size: 13px;
}

/* Submit button */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 12px;
    color: #0f172a;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Auth switch */
.auth-switch {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.auth-switch a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: #fbbf24;
}

/* Footer */
.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 8px;
    font-size: 13px;
    color: #475569;
}

.auth-footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #94a3b8;
}

/* Loading spinner */
.btn-loading {
    position: relative;
}

.btn-loading span,
.btn-loading svg {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Password strength indicator */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.password-strength .bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.password-strength .bar.weak { background: #ef4444; }
.password-strength .bar.medium { background: #f59e0b; }
.password-strength .bar.strong { background: #22c55e; }

/* Wider container for registration form */
.auth-container.auth-register {
    max-width: 680px;
}

@media (max-width: 720px) {
    .auth-container.auth-register {
        max-width: 520px;
    }

    .auth-container.auth-register .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .auth-container.auth-register .plan-selector {
        flex-direction: column;
    }

    .auth-container.auth-register .plan-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }
}

/* Responsive */
@media (max-width: 540px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .plan-selector {
        flex-direction: column;
    }

    .plan-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }

    .plan-desc {
        display: none;
    }
}
