/* =====================================================
   Alperriatra – Main Stylesheet
   ===================================================== */

:root {
    --primary: #2D7DD2;
    --primary-dark: #1A5FA8;
    --primary-light: #EBF4FF;
    --secondary: #3BB273;
    --secondary-dark: #2A8A55;
    --accent: #F97316;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #0F172A;
    --dark-2: #1E293B;
    --dark-3: #334155;
    --gray-100: #F8FAFC;
    --gray-200: #E2E8F0;
    --gray-400: #94A3B8;
    --gray-600: #475569;
    --white: #FFFFFF;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-display: 'Outfit', system-ui, sans-serif;
    --radius: 0.75rem;
    --radius-lg: 1.25rem;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 40px rgba(15, 23, 42, 0.14);
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Auth Pages ─────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.auth-brand-panel {
    background: linear-gradient(145deg, var(--dark) 0%, var(--dark-2) 50%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 125, 210, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 178, 115, 0.2) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
}

.brand-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(45, 125, 210, 0.4);
    position: relative;
    z-index: 1;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.brand-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 0.5rem;
}

.brand-subtitle {
    color: var(--gray-400);
    text-align: center;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    max-width: 280px;
}

.brand-features {
    margin-top: 2.5rem;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.brand-feature-item .feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--secondary);
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
    flex: 1;
}

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

.auth-card-header {
    margin-bottom: 2rem;
}

.auth-card-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.auth-card-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ─── Form Styles ────────────────────────────────── */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-3);
    margin-bottom: 0.375rem;
}

.form-control, .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: var(--dark);
    transition: border-color var(--transition), box-shadow var(--transition);
    background-color: var(--gray-100);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.15);
    background-color: var(--white);
    outline: none;
}

.input-group .form-control {
    border-right: none;
}

.input-group .input-group-text {
    border: 1.5px solid var(--gray-200);
    border-left: none;
    background: var(--gray-100);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: background var(--transition);
}

.input-group .input-group-text:hover {
    background: var(--gray-200);
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.5rem;
    transition: all var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(45, 125, 210, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #134980);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 125, 210, 0.45);
    color: var(--white);
}

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

.btn-success-custom {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(59, 178, 115, 0.35);
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, var(--secondary-dark), #1d6b41);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 178, 115, 0.45);
    color: var(--white);
}

.btn-outline-secondary {
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--dark);
}

/* ─── Alert / Notification ───────────────────────── */
.alert-custom {
    border-radius: var(--radius);
    padding: 0.875rem 1.125rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    border: none;
}

.alert-danger-custom {
    background: rgba(239, 68, 68, 0.08);
    color: #B91C1C;
    border-left: 4px solid var(--danger);
}

.alert-success-custom {
    background: rgba(59, 178, 115, 0.08);
    color: var(--secondary-dark);
    border-left: 4px solid var(--secondary);
}

/* ─── Dashboard / Navbar ─────────────────────────── */
.sidebar-nav {
    width: 260px;
    min-height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
}

.sidebar-logo-text span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav-links {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.5rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.sidebar-link.active {
    background: rgba(45, 125, 210, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-svg-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-svg-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.sidebar-bottom {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.user-info-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.05);
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* ─── Main Content Area ──────────────────────────── */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-100);
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ─── Profile Card ───────────────────────────────── */
.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.profile-card-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
}

.profile-avatar-lg {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.profile-email {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
}

.role-pill-admin {
    background: rgba(249, 115, 22, 0.2);
    color: #FED7AA;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.role-pill-veterinario {
    background: rgba(45, 125, 210, 0.2);
    color: #BFDBFE;
    border: 1px solid rgba(45, 125, 210, 0.35);
}

.role-pill-cliente {
    background: rgba(59, 178, 115, 0.2);
    color: #A7F3D0;
    border: 1px solid rgba(59, 178, 115, 0.35);
}

.profile-card-body {
    padding: 2rem;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
    border-bottom: none;
}

.info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.info-icon-blue { background: var(--primary-light); color: var(--primary); }
.info-icon-green { background: rgba(59, 178, 115, 0.1); color: var(--secondary); }
.info-icon-orange { background: rgba(249, 115, 22, 0.1); color: var(--accent); }

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.info-value {
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
}

/* ─── Role-specific accent colors ───────────────── */
.theme-admin .sidebar-link.active { background: rgba(249, 115, 22, 0.15); color: var(--accent); border-left-color: var(--accent); }
.theme-admin .sidebar-logo-icon { background: linear-gradient(135deg, var(--accent), #C2410C); }

.theme-veterinario .sidebar-link.active { background: rgba(45, 125, 210, 0.15); color: var(--primary); border-left-color: var(--primary); }

.theme-cliente .sidebar-link.active { background: rgba(59, 178, 115, 0.15); color: var(--secondary); border-left-color: var(--secondary); }
.theme-cliente .sidebar-logo-icon { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }

/* ─── Logout Button ──────────────────────────────── */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.08);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #FEE2E2;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─── Divider ────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--gray-400);
    font-size: 0.8rem;
}

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

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 992px) {
    .auth-brand-panel {
        display: none;
    }
    .sidebar-nav {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar-nav.show {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.25);
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: 5rem; /* Space for mobile header */
    }

    /* Mobile Header */
    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 4rem;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        z-index: 90;
        align-items: center;
        padding: 0 1.25rem;
        justify-content: space-between;
    }

    /* Backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 95;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

.mobile-header {
    display: none;
}

.sidebar-toggle-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--dark-2);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-toggle-btn:hover {
    background: var(--gray-200);
}

.close-sidebar-btn {
    display: none;
}

@media (max-width: 992px) {
    .close-sidebar-btn {
        display: flex;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: rgba(255,255,255,0.1);
        border: none;
        color: white;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        align-items: center;
        justify-content: center;
    }
}

/* ─── Animations ─────────────────────────────────── */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

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

.password-toggle-btn {
    cursor: pointer;
    user-select: none;
}
