/* ============================================
   MYCOBA - MASTER STYLESHEET
   Styles for: index, directory, register, cbo
   ============================================ */

/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --secondary: #38bdf8;
    --secondary-dark: #0ea5e9;
    --accent: #facc15;
    --success: #22c55e;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-dark); }

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--secondary); }
.logo i { color: var(--accent); font-size: 24px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.nav-links a {
    color: var(--gray-300);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: white;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links .btn-primary {
    background: var(--secondary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}
.nav-links .btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.3);
}
.nav-links .btn-primary::after { display: none; }

.nav-links .btn-login {
    background: transparent;
    color: white;
    border: 2px solid var(--gray-400);
    padding: 6px 18px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}
.nav-links .btn-login:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-2px);
}
.nav-links .btn-login::after { display: none; }

.nav-links .user-dropdown {
    position: relative;
    display: inline-block;
}
.nav-links .user-dropdown .user-btn {
    background: var(--secondary);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.nav-links .user-dropdown .user-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}
.nav-links .user-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: white;
    min-width: 200px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 8px 0;
    z-index: 100;
}
.nav-links .user-dropdown .dropdown-menu.show {
    display: block;
}
.nav-links .user-dropdown .dropdown-menu a {
    color: var(--gray-700);
    padding: 10px 20px;
    display: block;
    text-decoration: none;
    transition: var(--transition);
}
.nav-links .user-dropdown .dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.nav-links .user-dropdown .dropdown-menu a i {
    margin-right: 10px;
    width: 20px;
    color: var(--secondary);
}
.nav-links .user-dropdown .dropdown-menu .divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.mobile-toggle {
    display: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
}

/* ============================================
   HERO SLIDER (Homepage)
   ============================================ */
.hero-slider {
    margin: 24px 0 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.slides-wrapper {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    min-width: 100%;
    height: 480px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 60px;
    position: relative;
}
.slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.4) 100%);
}
.slide-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    color: white;
}
.slide-content .badge {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}
.slide-content h2 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}
.slide-content p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 28px;
    max-width: 480px;
}
.slide-content .btn {
    display: inline-block;
    padding: 14px 36px;
    background: var(--secondary);
    color: var(--primary);
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.3);
}
.slide-content .btn:hover {
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(250, 204, 21, 0.4);
}
.slide-content .btn i { margin-left: 8px; }

.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}
.slider-dot.active {
    background: var(--secondary);
    border-color: white;
    transform: scale(1.3);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-btn:hover {
    background: var(--secondary);
    color: var(--primary);
}
.slider-btn.prev { left: 20px; }
.slider-btn.next { right: 20px; }

/* ============================================
   STATS BAR (Homepage)
   ============================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    padding: 40px 0;
    background: white;
    margin: 30px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.stat-item {
    text-align: center;
    padding: 12px;
}
.stat-item .number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}
.stat-item .label {
    font-size: 0.95rem;
    color: var(--gray-500);
    font-weight: 500;
}
.stat-item i {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

/* ============================================
   SEARCH SECTION (Homepage & Directory)
   ============================================ */
.search-section {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}
.search-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
}
.search-section h2 i {
    color: var(--secondary);
    margin-right: 10px;
}

.search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.search-box input {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--gray-50);
}
.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.search-box select {
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--gray-50);
    cursor: pointer;
    min-width: 160px;
}
.search-box button {
    padding: 14px 32px;
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.search-box button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.3);
}
.search-box .clear-btn {
    display: flex;
    align-items: center;
    color: var(--gray-500);
    text-decoration: none;
    padding: 14px 16px;
    transition: var(--transition);
}
.search-box .clear-btn:hover { color: var(--danger); }

/* ============================================
   NEWS TICKER (Homepage)
   ============================================ */
.news-ticker {
    background: var(--primary);
    color: white;
    padding: 14px 0;
    border-radius: 60px;
    margin: 20px 0 40px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.news-ticker .container {
    display: flex;
    align-items: center;
    gap: 20px;
}
.ticker-label {
    background: var(--accent);
    color: var(--primary);
    font-weight: 700;
    padding: 4px 18px;
    border-radius: 40px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ticker-track {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}
.ticker-track ul {
    display: inline-block;
    list-style: none;
    animation: tickerScroll 25s linear infinite;
    padding: 0;
    margin: 0;
}
.ticker-track ul li {
    display: inline-block;
    padding: 0 40px;
    font-size: 0.95rem;
    color: var(--gray-300);
}
.ticker-track ul li i {
    color: var(--secondary);
    margin-right: 10px;
}
.ticker-track ul li strong { color: white; }

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   CBO GRID (Homepage & Directory)
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}
.section-header h2 i {
    color: var(--secondary);
    margin-right: 10px;
}
.section-header a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.section-header a:hover { color: var(--accent); }

.cbo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.cbo-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}
.cbo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}
.cbo-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary);
}
.cbo-card:hover::before {
    opacity: 1;
}
.cbo-card .icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--secondary);
    margin-bottom: 16px;
}
.cbo-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.cbo-card .reg-number {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-weight: 500;
    margin-bottom: 8px;
}
.cbo-card .description {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cbo-card .meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--gray-500);
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}
.cbo-card .meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cbo-card .meta i { color: var(--secondary); }
.cbo-card .btn-outline {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 24px;
    border: 2px solid var(--secondary);
    border-radius: 50px;
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}
.cbo-card .btn-outline:hover {
    background: var(--secondary);
    color: var(--primary);
}

/* ============================================
   FILTER TAGS (Directory)
   ============================================ */
.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0 8px;
}
.filter-tag {
    padding: 4px 16px;
    border-radius: 50px;
    background: var(--gray-200);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-tag .remove {
    cursor: pointer;
    color: var(--gray-500);
    text-decoration: none;
}
.filter-tag .remove:hover { color: var(--danger); }

/* ============================================
   PAGINATION (Directory)
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    padding: 8px 16px;
    border-radius: var(--radius);
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.pagination a:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.results-count {
    color: var(--gray-500);
    margin: 8px 0 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h3 {
    margin-bottom: 8px;
    color: var(--gray-700);
}

/* ============================================
   CBO PROFILE (cbo.php)
   ============================================ */
.cbo-profile {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    margin: 30px 0;
}

.cbo-profile .header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.cbo-profile .header .icon-big {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--secondary);
    flex-shrink: 0;
}

.cbo-profile .header .info h1 {
    font-size: 2rem;
    font-weight: 800;
}

.cbo-profile .header .info .reg {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.cbo-profile .header .info .meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.cbo-profile .header .info .meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
}

.cbo-profile .header .info .meta i {
    color: var(--secondary);
}

.cbo-profile .description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 30px;
}

.cbo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.cbo-stats .stat {
    text-align: center;
}

.cbo-stats .stat .number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.cbo-stats .stat .label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.members-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.members-section h3 i {
    color: var(--secondary);
    margin-right: 8px;
}

.members-table-wrapper {
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-width: 500px;
}

.members-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.members-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.members-table tr:hover td {
    background: var(--gray-50);
}

.members-table tr:last-child td {
    border-bottom: none;
}

.badge-role {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-role.admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-role.secretary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-role.member {
    background: #d1fae5;
    color: #065f46;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--gray-500);
    text-decoration: none;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--secondary);
}

.back-link i {
    margin-right: 8px;
}

/* ============================================
   CHECK USER SECTION (Register)
   ============================================ */
.check-user-section {
    background: white;
    padding: 24px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin: 30px 0 20px;
}
.check-user-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.check-user-section h3 i {
    color: var(--secondary);
    margin-right: 8px;
}
.check-user-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.check-user-box input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--gray-50);
}
.check-user-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.check-user-box input.error {
    border-color: var(--danger);
}
.check-user-box button {
    padding: 12px 28px;
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.check-user-box button:hover {
    background: var(--accent);
    transform: translateY(-2px);
}
.check-user-box button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.user-check-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: none;
}
.user-check-result.show {
    display: block;
}
.user-check-result.exists {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.user-check-result.not-exists {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.user-check-result .user-name {
    font-weight: 700;
}

/* ============================================
   REGISTRATION FORM (register.php)
   ============================================ */
.register-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 20px 0 40px;
    align-items: start;
}

.register-form {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.register-form h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.register-form .subtitle {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--gray-700);
}
.form-group label .required {
    color: var(--danger);
}
.form-group label .hint {
    font-weight: 400;
    color: var(--gray-400);
    font-size: 0.85rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--gray-50);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.form-group input.error,
.form-group select.error {
    border-color: var(--danger);
}
.form-group .error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}
.form-group .error-msg.show {
    display: block;
}

.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 44px;
}
.password-wrapper .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
}
.password-wrapper .toggle-password:hover {
    color: var(--gray-600);
}

/* CBO Search (Register) */
.cbo-search-wrapper {
    position: relative;
}
.cbo-search-wrapper .search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}
.cbo-search-wrapper .search-results.show {
    display: block;
}
.cbo-search-wrapper .search-results .result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
}
.cbo-search-wrapper .search-results .result-item:hover {
    background: var(--gray-50);
}
.cbo-search-wrapper .search-results .result-item .name {
    font-weight: 600;
}
.cbo-search-wrapper .search-results .result-item .reg {
    font-size: 0.85rem;
    color: var(--gray-500);
}
.cbo-search-wrapper .search-results .result-item .desc {
    font-size: 0.85rem;
    color: var(--gray-400);
}
.cbo-search-wrapper .search-results .no-results {
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
}

.selected-cbo {
    display: none;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 2px solid var(--secondary);
    margin-top: 8px;
}
.selected-cbo.show {
    display: block;
}
.selected-cbo .cbo-name {
    font-weight: 700;
    color: var(--primary);
}
.selected-cbo .cbo-reg {
    font-size: 0.85rem;
    color: var(--gray-500);
}
.selected-cbo .change-btn {
    margin-top: 8px;
    color: var(--secondary);
    cursor: pointer;
    font-weight: 600;
    background: none;
    border: none;
}
.selected-cbo .change-btn:hover {
    color: var(--accent);
}

/* Referral Code */
.referral-validation {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 8px;
}
.referral-validation.show {
    display: block;
}
.referral-validation.valid {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.referral-validation.invalid {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.referral-validation .referral-hint {
    font-size: 0.85rem;
    margin-top: 4px;
    color: var(--gray-500);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
}
.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.checkbox-group label {
    font-size: 0.95rem;
    color: var(--gray-600);
    cursor: pointer;
}
.checkbox-group label a {
    color: var(--secondary);
    text-decoration: none;
    cursor: pointer;
}
.checkbox-group label a:hover {
    color: var(--accent);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.3);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: none;
}
.alert.show {
    display: block;
}
.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ============================================
   INFO SIDEBAR (Register)
   ============================================ */
.register-info {
    background: var(--primary);
    color: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    position: sticky;
    top: 100px;
}
.register-info h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.register-info h2 i {
    color: var(--accent);
}
.register-info .feature {
    display: flex;
    gap: 16px;
    margin: 20px 0;
    align-items: flex-start;
}
.register-info .feature i {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-top: 4px;
    flex-shrink: 0;
}
.register-info .feature h4 {
    font-weight: 600;
    margin-bottom: 2px;
}
.register-info .feature p {
    color: var(--gray-300);
    font-size: 0.95rem;
}
.register-info .steps {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--primary-light);
}
.register-info .steps .step {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}
.register-info .steps .step .num {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.register-info .steps .step span {
    color: var(--gray-300);
}

/* Existing user notification */
.existing-user-notice {
    background: #dbeafe;
    border: 2px solid var(--secondary);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: none;
}
.existing-user-notice.show {
    display: block;
}
.existing-user-notice i {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-right: 10px;
}
.existing-user-notice strong {
    color: var(--primary);
}

/* ============================================
   POLICY MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
    display: flex;
}

.modal-policy {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}
.modal-policy .modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.modal-policy .modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}
.modal-policy .modal-header h2 i {
    color: var(--secondary);
    margin-right: 10px;
}
.modal-policy .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    padding: 0 8px;
}
.modal-policy .modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}
.modal-policy .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-policy .modal-body .policy-content {
    padding: 0;
    box-shadow: none;
    background: transparent;
}
.modal-policy .modal-body .policy-content h1 {
    font-size: 1.6rem;
}
.modal-policy .modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}
.modal-policy .modal-footer .btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.modal-policy .modal-footer .btn-primary {
    background: var(--secondary);
    color: var(--primary);
}
.modal-policy .modal-footer .btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
}
.modal-policy .modal-footer .btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.modal-policy .modal-footer .btn-secondary:hover {
    background: var(--gray-300);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   LOGIN/REGISTER MODAL (Homepage)
   ============================================ */
.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 440px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}
.modal h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}
.modal .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 24px;
}
.modal .tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--gray-200);
}
.modal .tabs button {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--gray-50);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}
.modal .tabs button.active {
    background: var(--primary);
    color: white;
}
.modal .tabs button:hover:not(.active) {
    background: var(--gray-200);
}
.modal .form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--gray-500);
}
.modal .form-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.modal .form-footer a:hover {
    color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--primary);
    color: var(--gray-300);
    padding: 60px 0 30px;
    margin-top: 60px;
    border-radius: 30px 30px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer h4 {
    color: white;
    font-weight: 700;
    margin-bottom: 16px;
}
.footer a {
    color: var(--gray-400);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: var(--transition);
}
.footer a:hover { color: var(--secondary); }
.footer .social-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.footer .social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.footer .social-links a:hover {
    background: var(--secondary);
    color: var(--primary);
}
.footer-bottom {
    border-top: 1px solid var(--primary-light);
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large screens */
@media (max-width: 992px) {
    .slide {
        height: 400px;
        padding: 0 40px;
    }
    .slide-content h2 {
        font-size: 2.4rem;
    }
    .register-wrapper {
        grid-template-columns: 1fr;
    }
    .register-info {
        position: static;
    }
    .cbo-profile .header .icon-big {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    .cbo-profile .header .info h1 {
        font-size: 1.6rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
        gap: 16px;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links .btn-primary,
    .nav-links .btn-login {
        width: 100%;
        text-align: center;
    }
    .nav-links .user-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--gray-50);
        border-radius: var(--radius);
    }
    .nav-links .user-dropdown .dropdown-menu a {
        color: var(--gray-300);
    }
    .nav-links .user-dropdown .dropdown-menu a:hover {
        background: var(--primary-light);
    }

    .slide {
        height: 320px;
        padding: 0 24px;
    }
    .slide-content h2 {
        font-size: 1.8rem;
    }
    .slide-content p {
        font-size: 0.95rem;
    }
    .slide-content .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 24px;
    }
    .stat-item .number {
        font-size: 1.8rem;
    }

    .search-section {
        padding: 24px;
    }
    .search-box input,
    .search-box select,
    .search-box button {
        width: 100%;
    }
    .search-box button {
        justify-content: center;
    }

    .news-ticker {
        border-radius: 30px;
    }
    .ticker-track ul li {
        padding: 0 20px;
        font-size: 0.85rem;
    }

    .cbo-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .register-form {
        padding: 24px;
    }
    .register-info {
        padding: 24px;
    }
    .register-form h1 {
        font-size: 1.6rem;
    }
    .check-user-section {
        padding: 16px;
    }
    .check-user-box input {
        min-width: 150px;
    }

    .modal-policy {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-policy .modal-body {
        padding: 16px;
    }

    .cbo-profile {
        padding: 24px;
    }
    .cbo-profile .header {
        gap: 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cbo-profile .header .info .meta {
        justify-content: center;
    }
    .cbo-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    .cbo-stats .stat .number {
        font-size: 1.3rem;
    }
    .members-table-wrapper {
        overflow-x: auto;
    }
    .members-table {
        min-width: 500px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .slide {
        height: 280px;
    }
    .slide-content h2 {
        font-size: 1.4rem;
    }
    .slide-content p {
        display: none;
    }
    .slider-btn {
        display: none;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
        padding: 16px;
    }
    .stat-item .number {
        font-size: 1.4rem;
    }

    .register-form {
        padding: 16px;
    }
    .register-info {
        padding: 16px;
    }
    .search-section {
        padding: 16px;
    }
    .cbo-card {
        padding: 20px 16px;
    }

    .cbo-profile {
        padding: 16px;
    }
    .cbo-profile .header .icon-big {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .cbo-profile .header .info h1 {
        font-size: 1.3rem;
    }
    .cbo-profile .header .info .meta {
        gap: 12px;
        font-size: 0.85rem;
        flex-direction: column;
        align-items: center;
    }
    .cbo-stats {
        grid-template-columns: 1fr 1fr;
    }
    .cbo-stats .stat .number {
        font-size: 1.1rem;
    }
    .cbo-stats .stat .label {
        font-size: 0.75rem;
    }
    .members-table th,
    .members-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.w-100 { width: 100%; }