/* Shared Authentication Styles for SBot GPS Studio */
/* Dark Theme with BCC Red Branding */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;900&display=swap');

:root {
  /* BCC red brand colors */
  --brand-h: 354; --brand-s: 86%; --brand-l: 54%;          /* BCC red */
  --brand: hsl(var(--brand-h) var(--brand-s) var(--brand-l));
  --brand-600: hsl(var(--brand-h) var(--brand-s) calc(var(--brand-l) - 8%));
  --brand-700: hsl(var(--brand-h) var(--brand-s) calc(var(--brand-l) - 14%));

  /* dark neutrals */
  --bg:    hsl(222 18% 8%);     /* page */
  --surface:hsl(222 18% 12%);    /* cards/sections */
  --text:  hsl(0 0% 98%);
  --muted: hsl(220 10% 66%);
  --line:  hsl(220 12% 20%);

  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 10px 40px rgba(0,0,0,.45);
}

/* Authentication Container */
#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg) 0%, hsl(222 18% 10%) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Procedural dots background */
    background:
        radial-gradient(hsl(0 0% 100% / .06) 1px, transparent 1px) 0 0 / 22px 22px,
        radial-gradient(hsl(0 0% 100% / .03) 1px, transparent 1px) 11px 11px / 22px 22px,
        linear-gradient(135deg, var(--bg) 0%, hsl(222 18% 10%) 100%);
}

#auth-container h2 {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* H1 Styling - Montserrat Bold 900 */
h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
}

/* Login Form */
#login-form {
    display: flex;
    flex-direction: column;
    width: 300px;
    gap: 15px;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--line);
}

#login-form input {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: hsl(222 18% 10%);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#login-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px hsl(var(--brand-h) var(--brand-s) / .1);
}

#login-form input::placeholder {
    color: var(--muted);
}

/* Authentication Buttons */
#login-button, #logout-button {
    padding: 12px 20px;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#login-button:hover, #logout-button:hover {
    background: var(--brand-600);
}

#login-button:active, #logout-button:active {
    background: var(--brand-700);
    transform: translateY(1px);
}

/* Error Messages */
.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* User Info Display */
#user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--line);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#user-info p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

#user-email {
    font-weight: 600;
    color: var(--brand);
}

/* Forgot Password Link */
#forgot-password-link {
    text-align: center;
    margin-top: 10px;
    color: #4285F4;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#forgot-password-link:hover {
    color: #3367d6;
    text-decoration: underline;
}

/* Password Reset Modal */
.modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--surface);
    margin: auto;
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: 80%;
    max-width: 400px;
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.2em;
    font-weight: 600;
}

.modal-content input[type="email"],
.modal-content input[type="text"],
.modal-content select {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: hsl(222 18% 10%);
    color: var(--text);
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px hsl(var(--brand-h) var(--brand-s) / .1);
}

.modal-content input::placeholder {
    color: var(--muted);
}

.modal-content button {
    padding: 10px 15px;
    background-color: var(--brand);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    font-size: 0.95rem;
}

.modal-content button:hover {
    background-color: var(--brand-600);
}

.modal-content .secondary-button {
    background-color: hsl(220 10% 40%);
}

.modal-content .secondary-button:hover {
    background-color: hsl(220 10% 35%);
}

.message {
    margin-top: 10px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Success message styling */
.message.success {
    color: #4CAF50;
}

/* Error message styling */
.message.error {
    color: #D32F2F;
}

/* Responsive Design */
@media (max-width: 480px) {
    #login-form {
        width: 90%;
        max-width: 300px;
        padding: 1.5rem;
    }
    
    #auth-container h2 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }
}

/* Focus states for accessibility */
#login-button:focus,
#logout-button:focus,
#forgot-password-link:focus,
.modal-content button:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Loading state for buttons */
.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.loading::after {
    content: "...";
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}
