/* Sapphire Point Login Page - Modern Blue Theme */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3969ab  50%, #5e35b1 75%, #0b1fa2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Static background elements */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.3) 0%, transparent 50%);
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(120, 119, 198, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
}

/* Falling particles background */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 15;
}

/* Falling particles */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: fall linear infinite;
}

/* Different sized particles */
.particle-small {
    width: 3px;
    height: 3px;
    opacity: 0.6;
}

.particle-medium {
    width: 5px;
    height: 5px;
    opacity: 0.8;
}

.particle-large {
    width: 7px;
    height: 7px;
    opacity: 0.4;
}

/* Particle positions and timings */
.particle-1 {
    left: 5%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.particle-2 {
    left: 15%;
    animation-duration: 12s;
    animation-delay: -2s;
}

.particle-3 {
    left: 25%;
    animation-duration: 10s;
    animation-delay: -4s;
}

.particle-4 {
    left: 35%;
    animation-duration: 14s;
    animation-delay: -1s;
}

.particle-5 {
    left: 45%;
    animation-duration: 9s;
    animation-delay: -3s;
}

.particle-6 {
    left: 55%;
    animation-duration: 11s;
    animation-delay: -5s;
}

.particle-7 {
    left: 65%;
    animation-duration: 13s;
    animation-delay: -2.5s;
}

.particle-8 {
    left: 75%;
    animation-duration: 15s;
    animation-delay: -6s;
}

.particle-9 {
    left: 85%;
    animation-duration: 7s;
    animation-delay: -1.5s;
}

.particle-10 {
    left: 95%;
    animation-duration: 16s;
    animation-delay: -4.5s;
}

.particle-11 {
    left: 10%;
    animation-duration: 18s;
    animation-delay: -3.5s;
}

.particle-12 {
    left: 30%;
    animation-duration: 6s;
    animation-delay: -2.2s;
}

.particle-13 {
    left: 50%;
    animation-duration: 20s;
    animation-delay: -7s;
}

.particle-14 {
    left: 70%;
    animation-duration: 8.5s;
    animation-delay: -1.8s;
}

.particle-15 {
    left: 90%;
    animation-duration: 12.5s;
    animation-delay: -5.5s;
}

.particle-16 {
    left: 8%;
    animation-duration: 14s;
    animation-delay: -2.8s;
}

.particle-17 {
    left: 18%;
    animation-duration: 9s;
    animation-delay: -6.2s;
}

.particle-18 {
    left: 28%;
    animation-duration: 16s;
    animation-delay: -1.2s;
}

.particle-19 {
    left: 38%;
    animation-duration: 11s;
    animation-delay: -4.8s;
}

.particle-20 {
    left: 48%;
    animation-duration: 13s;
    animation-delay: -7.1s;
}

.particle-21 {
    left: 58%;
    animation-duration: 8s;
    animation-delay: -3.6s;
}

.particle-22 {
    left: 68%;
    animation-duration: 17s;
    animation-delay: -5.9s;
}

.particle-23 {
    left: 78%;
    animation-duration: 10s;
    animation-delay: -2.4s;
}

.particle-24 {
    left: 88%;
    animation-duration: 15s;
    animation-delay: -6.7s;
}

.particle-25 {
    left: 12%;
    animation-duration: 7s;
    animation-delay: -1.8s;
}

.particle-26 {
    left: 22%;
    animation-duration: 19s;
    animation-delay: -4.3s;
}

.particle-27 {
    left: 32%;
    animation-duration: 6s;
    animation-delay: -7.5s;
}

.particle-28 {
    left: 42%;
    animation-duration: 18s;
    animation-delay: -3.1s;
}

.particle-29 {
    left: 52%;
    animation-duration: 9.5s;
    animation-delay: -5.7s;
}

.particle-30 {
    left: 62%;
    animation-duration: 21s;
    animation-delay: -2.9s;
}

/* Falling animation keyframes */
@keyframes fall {
    0% {
        transform: translateY(-100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(20px);
        opacity: 0;
    }
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 25;
    position: relative;
}

/* Logo Section */
.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.auth-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(100, 180, 255, 0.4));
}

.logo-text {
    color: white;
    text-align: left;
}

.company-name {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.company-subtitle {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 2px;
    margin: 0;
    margin-top: -8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Login Card */
.login-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    width: 400px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.login-container:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 20px;
    pointer-events: none;
}

.login-form {
    position: relative;
    z-index: 20;
}

.input-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #1e88e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

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

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.forgot-link:hover {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Signup Section */
.signup-section {
    margin-top: 25px;
    text-align: center;
}

.divider {
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    background: rgba(0, 0, 0, 0.3);
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    font-size: 12px;
    font-weight: 500;
}

.signup-prompt {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
}

.signup-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.signup-link:hover {
    color: #66BB6A;
    border-bottom-color: #4CAF50;
    text-decoration: none;
}

/* Flash Messages */
.flash {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid;
    font-size: 14px;
}

.flash-info {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.4);
    color: #bbdefb;
}

.flash-danger, .flash-error {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #ffcdd2;
}

.flash-success {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #c8e6c9;
}

.flash-warning {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ffe0b2;
}

/* Footer */
.footer {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    margin-top: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.flash-message {
    transition: opacity 0.5s;
}

.flash-message--fading {
    opacity: 0;
}

.hidden {
    display: none !important;
}

.password-match-msg {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.password-match-msg--ok {
    color: #4caf50;
}

.password-match-msg--error {
    color: #e74c3c;
}

.signup-address-row {
    display: flex;
    gap: 8px;
}

.signup-address-city {
    flex: 2;
}

.signup-address-state,
.signup-address-zip {
    flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    .login-wrapper {
        gap: 30px;
    }

    .logo-container {
        gap: 15px;
        margin-bottom: 15px;
    }

    .auth-logo {
        width: 60px;
    }

    .company-name, .company-subtitle {
        font-size: 32px;
    }

    .login-container {
        width: 100%;
        max-width: 350px;
        padding: 30px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .company-name, .company-subtitle {
        font-size: 28px;
    }

    .auth-logo {
        width: 50px;
    }

    .login-container {
        padding: 25px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-container {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }

    .form-input {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
}
