/* css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- 1. Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* --- 2. Global Setup with Dark Mode --- */
:root {
    --primary-color: #6f42c1;
    --primary-dark: #5a32a3;
    --bg-light: linear-gradient(135deg, #f5f7fa 0%, #e8ecf5 100%);
    --bg-dark: linear-gradient(135deg, #1a1f3a 0%, #16213e 100%);
    --card-light: #ffffff;
    --card-dark: #2d3561;
    --text-light: #333333;
    --text-dark: #E6E6E9;
    --input-light: #e0e0e0;
    --input-dark: #404570;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    transition: background 0.4s ease;
    color: var(--text-light);
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* --- 3. Navbar Styling --- */
.navbar-custom {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 15px 40px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(111, 66, 193, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

body.dark-mode .navbar-custom {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
    color: white !important;
    font-weight: 800;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
}

.nav-link {
    color: white !important;
    font-weight: 600;
    margin: 0 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.nav-icons {
    color: white;
    font-size: 1.2rem;
    gap: 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.nav-icons i {
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

.nav-icons i:hover {
    transform: scale(1.15) rotate(10deg);
    background: rgba(255, 255, 255, 0.2);
}

#themeToggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#themeToggle:hover {
    transform: scale(1.15) rotate(20deg);
    background: rgba(255, 255, 255, 0.2);
}

/* --- 4. Main Layout Wrapper --- */
.main-wrapper {
    flex: 1;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    padding: 40px 20px;
    position: relative;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 5. The Card Design --- */
.sb-card {
    background: var(--card-light);
    width: 100%;
    max-width: 500px;
    padding: 50px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(111, 66, 193, 0.15);
    transition: all 0.4s ease;
    animation: slideUp 0.6s ease;
}

body.dark-mode .sb-card {
    background: var(--card-dark);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.sb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(111, 66, 193, 0.25);
}

body.dark-mode .sb-card:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sb-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text; /* standard property for compatibility */
    -webkit-text-fill-color: transparent;
}

body.dark-mode .sb-card h3 {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial; /* reset standard property */
    -webkit-text-fill-color: var(--text-dark);
    color: var(--text-dark);
}

/* --- 6. Input Fields with Icons --- */
.sb-input-group {
    position: relative;
    margin-bottom: 25px;
    animation: slideInUp 0.6s ease;
    animation-fill-mode: both;
}

.sb-input-group:nth-child(1) {
    animation-delay: 0.1s;
}

.sb-input-group:nth-child(2) {
    animation-delay: 0.2s;
}

.sb-input-group:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sb-input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    z-index: 1;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.sb-input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid transparent;
    background: var(--input-light);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-light);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

body.dark-mode .sb-input-group input {
    background: var(--input-dark);
    color: var(--text-dark);
}

.sb-input-group input::placeholder {
    color: #999;
}

.sb-input-group input:focus {
    border-color: var(--primary-color);
    background: var(--input-light);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
    transform: translateY(-2px);
}

body.dark-mode .sb-input-group input:focus {
    background: var(--input-dark);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.3);
}

.sb-input-group input:focus~i {
    transform: translateY(-50%) scale(1.2);
    color: var(--primary-dark);
}

/* --- 6.1 Select Fields --- */
.sb-input-group select {
    width: 100%;
    padding: 15px 40px 15px 45px;
    border: 2px solid transparent;
    background-color: var(--input-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236f42c1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-light);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

body.dark-mode .sb-input-group select {
    background-color: var(--input-dark);
    color: var(--text-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E6E6E9' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.sb-input-group select:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.sb-input-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
    transform: translateY(-2px);
}

body.dark-mode .sb-input-group select:focus {
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.3);
}

.sb-input-group select option {
    color: var(--text-light);
    background: var(--card-light);
    padding: 10px;
}

body.dark-mode .sb-input-group select option {
    background: var(--card-dark);
    color: var(--text-dark);
}

/* Role toggle (pill-style) */
.role-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-toggle .role-toggle-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    flex-wrap: nowrap;
}
/* hide the left absolute icon placed by .sb-input-group for this row */
.role-toggle > i {
    display: none;
}
.role-toggle .role-toggle-buttons {
    margin-left: 45px; /* align with input fields that have left icon spacing */
}

.role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 20px;
    border-radius: 999px;
    border: 2px solid rgba(111,66,193,0.2);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

/* hide native radios */
.role-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.role-pill:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(111,66,193,0.15);
}

.role-pill:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(111,66,193,0.35);
    transform: translateY(-2px);
}

/* icon inside pill */
.role-pill i {
    margin-right: 10px;
    font-size: 1.05rem;
    width: 18px;
    text-align: center;
    color: rgba(111,66,193,0.95);
}
.role-pill:has(input[type="radio"]:checked) i {
    color: #fff;
}

body.dark-mode .role-pill {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-dark);
}

body.dark-mode .role-pill:hover {
    border-color: rgba(255,255,255,0.3);
}

body.dark-mode .role-pill:has(input[type="radio"]:checked) {
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ensure pills don't wrap awkwardly on very small screens */
@media (max-width: 420px) {
    .role-toggle {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .role-toggle .role-toggle-buttons {
        width: 100%;
        gap: 10px;
    }
    
    .role-pill { 
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

body.dark-mode .role-pill {
    border-color: rgba(255,255,255,0.15);
    color: var(--text-dark);
}

body.dark-mode .role-pill:hover {
    border-color: rgba(255,255,255,0.3);
}

body.dark-mode .role-toggle input[type="radio"]:checked + .role-pill {
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ensure pills don't wrap awkwardly on very small screens */
@media (max-width: 420px) {
    .role-toggle {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .role-toggle .role-toggle-buttons {
        width: 100%;
        gap: 10px;
    }
    
    .role-pill { 
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

body.dark-mode .role-pill {
    border-color: rgba(255,255,255,0.06);
    color: var(--text-dark);
}
body.dark-mode .role-toggle input[type="radio"]:checked + .role-pill {
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* ensure pills don't wrap awkwardly on very small screens */
@media (max-width: 420px) {
    .role-toggle .role-toggle-buttons {
        gap: 8px;
        margin-left: 20px;
    }
    .role-pill { min-width: 90px; padding: 8px 12px; }
}

/* --- 7. The Button --- */
.btn-purple {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    margin-top: 15px;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn-purple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-purple:hover::before {
    width: 300px;
    height: 300px;
}

.btn-purple:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(111, 66, 193, 0.5);
}

.btn-purple:active {
    transform: translateY(-1px);
}

/* --- 8. Links and Text --- */
.text-center {
    text-align: center;
    margin-top: 30px;
    color: #666;
    font-size: 0.9rem;
    animation: fadeIn 0.8s ease 0.5s both;
}

body.dark-mode .text-center {
    color: var(--text-dark);
}

.text-center a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.text-center a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.text-center a:hover::after {
    width: 100%;
}

.text-center a:hover {
    color: var(--primary-dark);
}

.alert {
    border-radius: 12px;
    margin-bottom: 20px;
    border: none;
    animation: slideDown 0.4s ease;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background-color: #ffe5e5;
    color: #c41e3a;
}

.alert-success {
    background-color: #e5ffe5;
    color: #2d7a2d;
}

/* --- 9. Footer --- */
.footer-custom {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 -4px 20px rgba(111, 66, 193, 0.3);
    transition: all 0.3s ease;
}

body.dark-mode .footer-custom {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

/* --- 10. Responsive Design --- */
@media (max-width: 768px) {
    .sb-card {
        padding: 40px 30px;
    }

    .navbar-custom {
        padding: 15px 20px;
    }

    .footer-custom {
        padding: 15px 20px;
        font-size: 0.85rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .nav-link {
        margin: 0 8px;
        font-size: 0.75rem;
    }

    .btn-purple {
        font-size: 0.9rem;
        padding: 12px;
    }

    .sb-card h3 {
        font-size: 1.5rem;
    }

    .nav-icons {
        gap: 10px;
        font-size: 1rem;
    }
}

/* --- 11. Profiles list and small components --- */
.profiles-grid { max-width:900px; margin:0 auto; }
.profile-card { text-decoration:none; color:inherit; }
.small-muted { color:#7a7a7a; font-size:0.9rem; }

/* subtle image placeholder */
.img-placeholder{ display:inline-flex; align-items:center; justify-content:center; font-weight:700; color:#999; background:linear-gradient(135deg,#f0f0f0,#e8e8e8); }
