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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-secondary);
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-block {
    width: 100%;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background: #fef2f2;
    color: var(--danger-color);
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Dashboard Page Styles */
.dashboard-page {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.navbar {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: var(--primary-color);
    font-size: 24px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.invoice-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.invoice-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.invoice-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.invoice-status.processing {
    background: #dbeafe;
    color: #2563eb;
}

.invoice-status.paid {
    background: #d1fae5;
    color: #059669;
}

.invoice-details {
    margin-bottom: 20px;
}

.invoice-date {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.invoice-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.invoice-actions {
    display: flex;
    gap: 12px;
}

.btn-pay {
    flex: 1;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pay:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-pay:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.no-invoices {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-body {
    overflow-x: hidden;
    word-wrap: break-word;
}

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

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 24px;
}

.invoice-summary {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.invoice-summary h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.invoice-summary .invoice-date {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.amount-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amount-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amount-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-success {
    text-align: center;
    padding: 40px 24px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-success h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-success p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.receipt-note {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* Public Invoice Page Styles */
.invoice-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-container {
    width: 100%;
    max-width: 800px;
}

.invoice-wrapper {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease-out;
}

.invoice-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.logo-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 14px;
}

.medivent-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 8px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.invoice-status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.invoice-status-badge.processing {
    background: #dbeafe;
    color: #2563eb;
}

.invoice-status-badge.paid {
    background: #d1fae5;
    color: #059669;
}

.invoice-details-section {
    margin-bottom: 32px;
}

.invoice-details-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.invoice-amount-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.amount-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: var(--text-primary);
}

.breakdown-item.total {
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-section {
    text-align: center;
}

.btn-large {
    padding: 16px 48px;
    font-size: 18px;
    min-width: 200px;
}

.btn.disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn.disabled:hover {
    background: var(--border-color);
    transform: none;
    box-shadow: none;
}

.secure-payment-note {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lock-icon {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }

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

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

    .nav-container {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
    }

    .invoice-wrapper {
        padding: 32px 24px;
    }

    .invoice-header-section {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .invoice-info-grid {
        grid-template-columns: 1fr;
    }

    .btn-large {
        width: 100%;
        min-width: auto;
    }
}

