* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #87BCD4;
    --primary-dark: #6ba3c0;
    --white: #ffffff;
    --gray-800: #343a40;
    --gray-900: #212529;
    --success-color: #10b981;
    --success-dark: #059669;
    --error-color: #ef4444;
    --error-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--white) 100%);
    min-height: 100vh;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 20px;
}

.login-card,
.register-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
    animation: slideInUp 0.5s ease;
    position: relative;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: transparent;
    font-family: inherit;
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 12px;
    color: #999;
    transition: all 0.3s;
    pointer-events: none;
    font-size: 14px;
}

.form-group input:focus,
.form-group input:valid,
.form-group textarea:focus,
.form-group textarea:valid {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 10px rgba(135, 188, 212, 0.2);
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    background: var(--white);
    padding: 0 5px;
    color: var(--primary-color);
    font-weight: 600;
}

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 12px;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
}

.btn-login,
.btn-save {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover,
.btn-save:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(135, 188, 212, 0.3);
}

.form-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    border-radius: 20px;
    z-index: 10;
}

.form-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.form-loader-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(135,188,212,0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-link,
.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.login-link a,
.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.login-link a:hover,
.register-link a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* Modern Alert/Toast Styles */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background-color: #fee;
    color: #c00;
    border-left: 4px solid #c00;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

/* Modern Toast Notification System */
.toast-notification {
    position: fixed;
    top: 90px;
    right: 20px;
    min-width: 320px;
    max-width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 10000;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
}

.toast-notification.hide {
    animation: slideOutRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
}

.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-message p {
    margin: 0;
}

.toast-message small {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #666;
}

.toast-progress {
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    position: relative;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    animation: progressShrink 3s linear forwards;
}

@keyframes progressShrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Toast Variants */
.toast-notification.toast-success {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-left: 4px solid var(--success-color);
}

.toast-notification.toast-success .toast-icon {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    color: white;
}

.toast-notification.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, var(--success-color), var(--success-dark));
}

.toast-notification.toast-error {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border-left: 4px solid var(--error-color);
}

.toast-notification.toast-error .toast-icon {
    background: linear-gradient(135deg, var(--error-color), var(--error-dark));
    color: white;
}

.toast-notification.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, var(--error-color), var(--error-dark));
}

.toast-notification.toast-warning {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border-left: 4px solid var(--warning-color);
}

.toast-notification.toast-warning .toast-icon {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.toast-notification.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, var(--warning-color), #d97706);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    border-left: 4px solid var(--info-color);
}

.toast-notification.toast-info .toast-icon {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    color: white;
}

.toast-notification.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, var(--info-color), #2563eb);
}

/* Container for multiple toasts */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Modal Styles */
.center-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.center-modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.center-modal h3 {
    margin-bottom: 15px;
    color: var(--gray-900);
    font-size: 1.4rem;
}

.center-modal .btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.center-modal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(135, 188, 212, 0.3);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checkbox-group label {
    position: static;
    color: #666;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-group label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-group label a:hover {
    text-decoration: underline;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.forgot-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.alert-error a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}
.alert-error a:hover {
    color: #ffd700;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 80px 15px 15px;
    }

    .login-card,
    .register-card {
        padding: 30px;
        border-radius: 15px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .toggle-password {
        right: 12px;
        top: 10px;
        font-size: 18px;
    }
    
    .toast-notification {
        min-width: 280px;
        max-width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        top: 80px;
    }
    
    .toast-container {
        right: 20px;
        left: 20px;
        top: 80px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 60px 10px 10px;
    }

    .login-card,
    .register-card {
        padding: 20px;
        border-radius: 12px;
        max-width: 100%;
    }

    h2 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    .form-group label {
        left: 10px;
        font-size: 13px;
    }

    .btn-login,
    .btn-save {
        padding: 10px;
        font-size: 14px;
    }

    .form-loader-overlay .spinner {
        width: 35px;
        height: 35px;
        border: 3px solid rgba(135,188,212,0.3);
        border-top: 3px solid var(--primary-color);
    }

    .login-link,
    .register-link {
        font-size: 12px;
        margin-top: 15px;
    }
    
    .toast-notification {
        min-width: auto;
        right: 10px;
        left: 10px;
        top: 75px;
    }
    
    .toast-content {
        padding: 12px 16px;
    }
    
    .toast-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}