* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2196F3;
    --primary-hover: #1976D2;
    --bg-dark: #1a1a1a;
    --bg-darker: #141414;
    --text-light: #ffffff;
    --text-muted: #b3b3b3;
    --error-color: #ff6b6b;
    --border-color: #404040;
    --input-bg: #2d2d2d;
    --rainhub-blue: #2196F3;
    --rainhub-dark: #1976D2;
}

body {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* For iOS */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rainhub-blue), var(--rainhub-dark));
}

/* Initial page load animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    background: rgba(45, 45, 45, 0.95);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    animation: fadeIn 0.8s ease-out;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--rainhub-blue), var(--rainhub-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-header h2 {
    color: var(--text-light);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, var(--rainhub-blue), var(--rainhub-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 3rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove default iOS styling */
}

.form-group input:focus {
    outline: none;
    border-color: var(--rainhub-blue);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

.form-group input:focus + i {
    color: var(--rainhub-blue);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group button {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(90deg, var(--rainhub-blue), var(--rainhub-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.form-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.form-group button:active {
    transform: translateY(0);
}

.form-group button i {
    transition: transform 0.3s ease;
}

.form-group button:hover i {
    transform: translateX(4px);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    color: var(--rainhub-blue);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    padding: 0.3rem 0.5rem; /* Larger touch target */
}

.form-footer a:hover {
    color: var(--rainhub-dark);
}

.form-footer a i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.form-footer a:hover i {
    transform: translateX(2px);
}

.form-footer p {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.error-message {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
    padding: 0.75rem;
    background: rgba(179, 179, 179, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--text-muted);
    line-height: 1.4;
}

.error-message:not(:empty) {
    display: block;
}

/* Style for actual error messages */
.form-group input.error + .error-message {
    color: var(--error-color);
    background: rgba(255, 107, 107, 0.1);
    border-left-color: var(--error-color);
    animation: shake 0.5s ease-in-out;
}

.form-group input.error {
    border-color: var(--error-color);
    background: rgba(255, 107, 107, 0.05);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.version-info {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .login-container {
        padding: 1.5rem;
        margin: 0;
        border-radius: 12px;
    }

    .logo {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .login-header h2 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .form-group input {
        padding: 0.8rem 1rem 0.8rem 2.8rem;
        font-size: 0.95rem;
    }

    .form-group button {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .form-footer {
        margin-top: 1rem;
    }

    .form-footer a {
        font-size: 0.85rem;
    }

    .form-footer p {
        font-size: 0.85rem;
    }

    .error-message {
        font-size: 0.8rem;
        padding: 0.6rem;
    }

    .version-info {
        margin-top: 1.5rem;
        font-size: 0.75rem;
    }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio:0) { 
    select,
    textarea,
    input {
        font-size: 16px;
    }
} 