/* TECHBOARD Login Styles */

:root {
    --primary-color: #0078d4;
    --primary-hover: #106ebe;
    --secondary-color: #f3f2f1;
    --accent-color: #ff6b35;
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --background: #ffffff;
    --surface: #faf9f8;
    --border: #edebe9;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.2);
    --error: #d13438;
    --success: #107c10;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 50%, #1a202c 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="90" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-welcome-box {
    text-align: center;
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo .logo-image {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 32px;
    margin-top: 8px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.login-error i {
    font-size: 16px;
    flex-shrink: 0;
}

.login-success {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.login-success i {
    font-size: 16px;
    flex-shrink: 0;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.input-wrapper.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.input-wrapper input::placeholder {
    color: #a0a0a0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.btn-main {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.btn-main:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn-main:active {
    transform: translateY(0);
}

.btn-main i {
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

/* Loading state */
.btn-main.loading {
    pointer-events: none;
    position: relative;
}

.btn-main.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success animation */
.login-container.success {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        margin: 20px;
        padding: 32px 24px;
        max-width: none;
    }

    .login-logo h1 {
        font-size: 24px;
    }

    .login-title {
        font-size: 20px;
    }

    .input-wrapper input {
        padding: 12px 12px 12px 40px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn-main {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a1a;
        --surface: #2d2d2d;
        --border: #404040;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
    }

    .login-container {
        background: rgba(45, 45, 45, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .input-wrapper input {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-primary);
    }

    .input-wrapper input:focus {
        border-color: var(--primary-color);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.input-wrapper input:focus-visible,
.btn-main:focus-visible,
.checkbox-label:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-container {
        border: 2px solid;
    }

    .input-wrapper input {
        border-width: 3px;
    }

    .btn-main {
        border: 2px solid;
    }
}