/* ==================================================
   Modern styling + animations for billing portal
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

* {
    transition: all 0.2s ease-in-out;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ----- Auth pages (login, register, forgot, reset) ----- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-card h3 {
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
}

.auth-card .form-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    border-radius: 16px;
    border: 1.5px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-card .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    outline: none;
}

/* ========== BUTTON FIXES – STRONG CONTRAST & WHITE TEXT ========== */
.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.auth-card .btn-primary,
.auth-card .btn-success,
.search-box .btn-primary,
.search-box .btn-success,
.order-card .btn-primary,
.order-card .btn-success,
.card .btn-primary,
.card .btn-success,
a.btn-primary,
a.btn-success {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    border: none !important;
    border-radius: 40px;
    padding: 0.75rem 1.5rem;
    font-weight: 700 !important;
    font-size: 1rem;
    letter-spacing: 0.3px;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

/* Override Bootstrap's default btn-success colors completely */
.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: white !important;
}

.btn-primary:hover,
.btn-success:hover,
.auth-card .btn-primary:hover,
.auth-card .btn-success:hover,
.search-box .btn-primary:hover,
.search-box .btn-success:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: #ffffff !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #0e9f6e 100%) !important;
}

.btn-primary:active,
.btn-success:active {
    transform: translateY(1px);
}

.btn-primary:focus,
.btn-success:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

/* Outline buttons – readable text */
.btn-outline-secondary {
    color: #2d3748 !important;
    border-color: #cbd5e0;
    background: white;
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background: #edf2f7;
    color: #1a202c !important;
    border-color: #a0aec0;
}

/* Danger buttons (Delete, etc.) */
.btn-outline-danger {
    font-weight: 500;
}

.btn-outline-danger:hover {
    color: white !important;
    background: #dc2626;
}

/* Ensure any link styled as button has white text */
a.btn, button.btn {
    color-scheme: only light;
}
/* ================================================== */

.auth-card .alert {
    border-radius: 20px;
    border-left: 5px solid;
}

.auth-card a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-card a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* ----- Client portal (logged-in) enhancements ----- */
.sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    border-radius: 12px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.main-content {
    animation: fadeSlideUp 0.5s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    border: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.2);
}

.table-hover tbody tr {
    transition: background 0.2s, transform 0.1s;
}

.table-hover tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.08);
    transform: scale(1.01);
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-backdrop.show {
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
    .auth-card .card-body {
        padding: 1.5rem;
    }
    .main-content {
        padding: 1.25rem;
    }
}