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

:root {
    --primary-light: #72CEF5;
    --primary-medium: #009DDC;
    --primary-dark: #017DC3;
    --accent-light: #A0CF67;
    --accent-dark: #53B949;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --error-color: #ff6b6b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 50%, var(--accent-dark) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Animated background shapes */
.background {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 350px;
    height: 350px;
    background: var(--accent-light);
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.shape:nth-child(3) {
    width: 300px;
    height: 300px;
    background: var(--primary-medium);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* Login container with glassmorphism */
.login-container {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container h1 {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Form styling */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input[type="email"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(114, 206, 245, 0.2);
}

/* Checkbox styling */
.storage-option {
    flex-direction: row;
    align-items: center;
    margin-top: 5px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.checkbox-container:hover .checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Error message */
.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid var(--error-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Login button */
.login-button {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-light) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(83, 185, 73, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loader animation */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer text */
.footer-text {
    margin-top: 30px;
    text-align: center;
}

.footer-text p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Portal page common styles */
.portal-container {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    min-height: 600px;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-header h1 {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    color: var(--text-secondary);
    font-size: 14px;
}

.logout-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 10px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.portal-content {
    color: var(--text-primary);
}

.portal-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.portal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        padding: 40px 30px;
        margin: 20px;
    }
    
    .logo-container h1 {
        font-size: 28px;
    }
    
    .portal-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .portal-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
}

/* Fix cursor: ensure text inputs show I-beam (not pointer) */
input[type="text"],
input[type="search"],
textarea {
  cursor: text !important;
}
