/* Client Portal Styles - Matching Main Theme */
:root {
    --primary-blue: #1e3c72;
    --primary-blue-dark: #1a3467;
    --primary-blue-light: #2d559b;
    --accent-teal: #20a5a5; 
    --accent-cyan: #4dd0e1; 
    --brand-green: #27ae60;
    --brand-green-light: #2ecc71;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --light-bg: #f8fafc;
    --shadow-light: rgba(30, 60, 114, 0.1);
    --shadow-medium: rgba(30, 60, 114, 0.2);
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #2ecc71;
} 

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* Authentication Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    padding: 2rem;
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    border-radius: 50%;
    color: var(--white);
    font-size: 2rem;
}

.auth-title {
    font-size: 1.8rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.back-to-website-auth {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 60, 114, 0.1);
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 60, 114, 0.2);
}

.back-to-website-auth:hover {
    background: rgba(30, 60, 114, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 60, 114, 0.1);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
    background-color: var(--white);
}

.form-input.error {
    border-color: var(--danger);
}

/* Textarea styling */
.form-input[rows] {
    resize: vertical;
    min-height: 80px;
}

/* Required field indicator */
.form-label:has(+ .form-input[required])::after,
.form-label:has(+ select[required])::after {
    content: " *";
    color: var(--danger);
}

/* Select dropdown styling */
select.form-input {
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23666" d="M6 9L1.5 4.5h9L6 9z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 3rem;
    appearance: none;
}

/* NRC formatting styles */
#nrc, 
#email_or_nrc, 
#reset_identifier {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

#nrc::placeholder,
#email_or_nrc::placeholder,
#reset_identifier::placeholder {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: normal;
    font-style: italic;
    opacity: 0.7;
}

/* Visual feedback for formatted NRC */
.nrc-formatted {
    background-color: #f0f9ff !important;
    border-color: var(--brand-green) !important;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 60, 114, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-success {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning);
    border: 1px solid rgba(243, 156, 18, 0.2);
}

.alert h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.alert ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.alert ul li {
    margin: 0.25rem 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    background-color: var(--light-bg);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    color: var(--white);
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.dashboard-logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-website {
    margin-left: 2rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-to-website:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.card-icon.blue {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
}

.card-icon.teal {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
}

.card-icon.green {
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-light));
}

.card-title {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
}

.card-content {
    color: var(--text-light);
}

/* Profile Form */
.profile-form {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light-bg);
}

.nav-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.nav-tab.active {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--primary-blue);
}

.nav-tab:hover {
    color: var(--primary-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-green-light));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Responsive Design - Enhanced Mobile First Approach */
/* Extra Small Devices (Phones, 320px and up) */
@media (max-width: 359px) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-card {
        padding: 1rem;
        margin: 0;
        border-radius: 8px;
        min-width: 0;
    }
    
    .auth-title {
        font-size: 1.3rem;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .form-input {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .dashboard-nav {
        padding: 0.5rem;
    }
    
    .dashboard-main {
        padding: 0.5rem;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .profile-form {
        padding: 1rem;
    }
}

/* Small Devices (Phones, 360px to 480px) */
@media (min-width: 360px) and (max-width: 480px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 0;
        border-radius: 8px;
        position: relative;
    }
    
    .back-to-website-auth {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Dashboard Mobile */
    .dashboard-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0.5rem;
        text-align: center;
    }
    
    .dashboard-logo {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .back-to-website {
        margin-left: 0;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .dashboard-user {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .dashboard-user button {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .dashboard-main {
        padding: 1rem 0.5rem;
    }
    
    .nav-tabs {
        flex-direction: column;
        gap: 0.5rem;
        border-bottom: none;
    }
    
    .nav-tab {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        border: 2px solid var(--light-bg);
        text-align: center;
        width: 100%;
    }
    
    .nav-tab.active {
        border-color: var(--primary-blue);
        background-color: var(--primary-blue);
        color: var(--white);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* Profile Form Mobile */
    .profile-form {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        text-align: center;
    }
    
    .alert {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .alert h4 {
        font-size: 1rem;
    }
    
    .progress-text {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
    }
}

/* Medium Devices (Tablets, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-container {
        padding: 1.5rem;
    }
    
    .auth-card {
        max-width: 500px;
        padding: 2.5rem;
    }
    
    .dashboard-nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .dashboard-logo {
        font-size: 1.4rem;
    }
    
    .dashboard-user {
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
    }
    
    .dashboard-main {
        padding: 1.5rem;
    }
    
    .nav-tabs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 0.875rem 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .dashboard-card:nth-child(odd):last-child {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .form-section .form-grid .form-group:nth-child(odd):last-child {
        grid-column: 1 / -1;
    }
    
    .profile-form {
        padding: 2rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
}

/* Large Tablets (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .auth-card {
        max-width: 550px;
        padding: 3rem;
    }
    
    .dashboard-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 2rem;
    }
    
    .dashboard-logo {
        font-size: 1.5rem;
    }
    
    .dashboard-user {
        flex-direction: row;
        gap: 1rem;
    }
    
    .dashboard-main {
        padding: 2rem 1.5rem;
    }
    
    .nav-tabs {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-tab {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 1rem 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .profile-form {
        padding: 2.5rem;
    }
}

/* Small Desktop (1025px to 1199px) */
@media (min-width: 1025px) and (max-width: 1199px) {
    .dashboard-main {
        max-width: 1000px;
        padding: 2rem;
    }
    
    .dashboard-nav {
        padding: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .nav-tabs {
        gap: 1rem;
    }
    
    .nav-tab {
        padding: 1rem 2rem;
    }
    
    .auth-card {
        max-width: 500px;
        padding: 3rem;
    }
    
    .profile-form {
        padding: 2.5rem;
    }
}

/* Large Desktop (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .dashboard-main {
        max-width: 1200px;
        padding: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .auth-card {
        max-width: 500px;
        padding: 3rem;
    }
    
    .profile-form {
        padding: 3rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}

/* Extra Large Screens (1400px and up) */
@media (min-width: 1400px) {
    .dashboard-main {
        max-width: 1400px;
        padding: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .auth-card {
        max-width: 550px;
        padding: 3.5rem;
    }
    
    .profile-form {
        padding: 3rem;
    }
    
    .nav-tabs {
        gap: 1.5rem;
    }
    
    .nav-tab {
        padding: 1rem 2.5rem;
    }
}

/* Responsive Utility Classes */
.hide-mobile {
    display: none;
}

.hide-tablet {
    display: block;
}

.hide-desktop {
    display: block;
}

/* Mobile view specific styles */
.mobile-view .auth-container {
    padding: 1rem;
}

.mobile-view .auth-card {
    padding: 2rem 1.5rem;
    margin: 0;
    border-radius: 12px;
    max-width: none;
    width: 100%;
}

.mobile-view .dashboard-header {
    padding: 1rem;
}

.mobile-view .dashboard-logo span {
    display: none;
}

.mobile-view .nav-tabs {
    justify-content: center;
    padding: 0.5rem;
}

.mobile-view .nav-tab {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
}

.mobile-view .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mobile-view .form-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 481px) {
    .hide-mobile {
        display: block;
    }
    
    .hide-tablet {
        display: none;
    }
}

@media (min-width: 1025px) {
    .hide-tablet {
        display: block;
    }
    
    .hide-desktop {
        display: none;
    }
}

/* Responsive Text Utilities */
.text-center-mobile {
    text-align: center;
}

.text-left-mobile {
    text-align: left;
}

@media (min-width: 769px) {
    .text-center-mobile {
        text-align: left;
    }
    
    .text-left-mobile {
        text-align: left;
    }
}

/* Responsive Spacing Utilities */
.mb-mobile {
    margin-bottom: 1rem;
}

.mb-tablet {
    margin-bottom: 1.5rem;
}

.mb-desktop {
    margin-bottom: 2rem;
}

@media (min-width: 481px) {
    .mb-mobile {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .mb-mobile {
        margin-bottom: 2rem;
    }
    
    .mb-tablet {
        margin-bottom: 2rem;
    }
}

/* Responsive Flex Utilities */
.flex-column-mobile {
    display: flex;
    flex-direction: column;
}

.flex-row-mobile {
    display: flex;
    flex-direction: row;
}

@media (min-width: 769px) {
    .flex-column-mobile {
        flex-direction: row;
    }
    
    .flex-row-mobile {
        flex-direction: row;
    }
}

/* Enhanced Focus States for Better Accessibility */
.btn:focus,
.nav-tab:focus,
.form-input:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.btn:focus-visible,
.nav-tab:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Enhanced Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Enhanced Error States */
.form-input.error {
    border-color: var(--danger);
    background-color: rgba(231, 76, 60, 0.05);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Enhanced Success States */
.form-input.success {
    border-color: var(--success);
    background-color: rgba(46, 204, 113, 0.05);
}

.form-input.success:focus {
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.success-message {
    color: var(--success);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 150px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* Enhanced Responsive Images */
.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Enhanced Container Queries Support */
@container (max-width: 400px) {
    .dashboard-card {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@container (min-width: 401px) and (max-width: 800px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (min-width: 801px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Enhanced Scroll Behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Enhanced Form Validation Styles */
.form-group.required .form-label::after {
    content: " *";
    color: var(--danger);
}

.form-group.optional .form-label::after {
    content: " (optional)";
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Enhanced Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.mobile-menu.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 90%;
    width: 300px;
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Final Responsive Adjustments */
@media (max-width: 320px) {
    .form-input {
        font-size: 14px;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
    
    .auth-title {
        font-size: 1.2rem;
    }
    
    .dashboard-main {
        padding: 0.75rem 0.25rem;
    }
}

@media (min-width: 2560px) {
    .dashboard-main {
        max-width: 2000px;
    }
    
    .auth-card {
        max-width: 700px;
        padding: 5rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 3rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 3rem;
    }
}

/* Mobile Loading Overlay */
body.loading {
    overflow: hidden;
}

body.loading::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.loading::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(30, 60, 114, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
    z-index: 10001;
}

/* Touch Feedback */
.touch-active {
    background-color: rgba(30, 60, 114, 0.1) !important;
    transform: scale(0.98) !important;
}

/* Mobile-specific form improvements */
@media (max-width: 768px) {
    .form-input:focus {
        transform: scale(1.02);
        transition: transform 0.2s ease;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Improve tap targets */
    .nav-tab,
    .btn,
    .form-input {
        min-height: 48px;
    }
    
    /* Better spacing for mobile forms */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    /* Mobile alert improvements */
    .alert {
        position: relative;
        margin: 1rem 0;
        border-radius: 12px;
        padding: 1.25rem;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .alert .btn {
        margin-top: 1rem;
        width: 100%;
    }
    
    /* Mobile dashboard improvements */
    .dashboard-card {
        margin-bottom: 1rem;
        border-radius: 16px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
    
    .dashboard-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Mobile navigation improvements */
    .nav-tabs {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--white);
        padding: 1rem 0.5rem 0.5rem;
        margin: 0 -0.5rem 1rem;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .nav-tab {
        border-radius: 12px;
        font-weight: 600;
        transition: all 0.2s ease;
    }
    
    .nav-tab:active {
        transform: scale(0.95);
    }
    
    /* Mobile form section improvements */
    .form-section {
        background: var(--white);
        border-radius: 16px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .section-title {
        position: sticky;
        top: 80px;
        background: var(--white);
        z-index: 10;
        margin: -1.5rem -1.5rem 1rem;
        padding: 1rem 1.5rem;
        border-radius: 16px 16px 0 0;
        border-bottom: 2px solid var(--light-bg);
    }
}

/* Tablet-specific improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid {
        gap: 1.5rem;
    }
    
    .dashboard-card {
        border-radius: 12px;
        transition: all 0.3s ease;
    }
    
    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .form-section {
        margin-bottom: 2rem;
    }
    
    .nav-tabs {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-tab {
        min-width: 120px;
        padding: 1rem 1.5rem;
    }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
    .dashboard-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .dashboard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    }
    
    .form-input:focus {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(30, 60, 114, 0.15);
    }
    
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(30, 60, 114, 0.25);
    }
    
    .nav-tab:hover {
        background-color: rgba(30, 60, 114, 0.05);
    }
}

/* Smooth scrolling for all devices */
* {
    scroll-behavior: smooth;
}

/* Enhanced focus indicators */
.form-input:focus,
.btn:focus,
.nav-tab:focus {
    outline: 3px solid rgba(30, 60, 114, 0.3);
    outline-offset: 2px;
}

/* Better button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading button state */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced alert dismiss */
.alert {
    position: relative;
    padding-right: 3rem;
}

.alert-dismiss {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-dismiss:hover {
    opacity: 1;
}

/* Better mobile keyboard handling */
@media (max-width: 768px) {
    .form-input:focus {
        position: relative;
        z-index: 10;
    }
    
    /* Prevent zoom on form inputs */
    .form-input {
        font-size: 16px;
        max-height: 60px;
    }
    
    select.form-input {
        font-size: 16px;
    }
    
    /* Better mobile viewport handling */
    .auth-container {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height */
    }
    
    .dashboard {
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    /* Specific styling for Create Account button mobile fix */
    .create-account-btn {
        position: relative !important;
        z-index: 10 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .create-account-btn:active,
    .create-account-btn:focus,
    .create-account-btn:hover {
        background-color: #6c757d !important;
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }
}
