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

/*
 * Auth page styling - matches the Chuti game application theme
 * Uses the gamer color palette with purple accents
 */

:root {
    --auth-bg: #ffffff;
    --auth-text: rgb(42 30 51);
    --auth-accent: #59228C;
    --auth-accent-light: #CDAFEA;
    --auth-form-bg: rgb(250 248 252);
    --auth-border: rgb(205 175 234);
    --auth-button: #59228C;
    --auth-button-hover: #7a3cb8;
    --auth-gold: rgb(180, 145, 50);
    --auth-link: #59228C;
}

body {
    background-color: var(--auth-bg);
    color: var(--auth-text);
    font-family: 'Jura', sans-serif;
    background-repeat: repeat;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.auth {
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Jura', sans-serif;
    line-height: 24px;
    padding: 48px 32px;
    max-width: 600px;
    margin: 0 auto;
}

.auth h1 {
    color: var(--auth-accent);
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 2.5rem;
}

/* Logo before the h1 text */
.auth h1::before {
    content: '';
    display: block;
    width: 160px;
    height: 160px;
    background-image: url('../images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto 16px auto;
}

.auth h2, .auth h3 {
    font-family: 'Jura', sans-serif;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    margin-top: 16px;
    color: var(--auth-accent);
}

.auth .instructions {
    text-align: center;
    font-size: 14px;
    margin-top: 8px;
    color: var(--auth-text);
    opacity: 0.9;
    padding-bottom: 20px;
}

.auth form {
    background-color: var(--auth-form-bg);
    width: 100%;
    max-width: 448px;
    display: block;
    padding: 24px;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid var(--auth-border);
    box-shadow: 0 8px 32px rgba(89, 34, 140, 0.15);
    margin: 24px auto;
    transition: box-shadow 0.3s ease;
}

.auth form:hover {
    box-shadow: 0 12px 40px rgba(89, 34, 140, 0.25);
}

.auth button {
    transition: all 0.2s ease;
    color: #ffffff;
    font-family: 'Jura', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
    background-color: var(--auth-button);
    border-radius: 8px;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    display: inline-flex;
    cursor: pointer;
    text-transform: none;
    margin-top: 24px;
    margin-bottom: 16px;
    border: 2px solid var(--auth-accent-light);
    line-height: 1.4;
}

.auth button:hover {
    background-color: var(--auth-button-hover);
    border-color: var(--auth-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(89, 34, 140, 0.3);
}

.auth button:active {
    transform: translateY(0);
}

.auth input {
    background-color: #ffffff;
    border: 2px solid var(--auth-border);
    color: var(--auth-text);
    border-radius: 8px;
    display: flex;
    font-family: 'Jura', sans-serif;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(89, 34, 140, 0.3);
}

.auth input::placeholder {
    color: rgba(89, 34, 140, 0.5);
}

.auth label {
    margin-top: 16px;
    margin-bottom: 6px;
    display: block;
    line-height: 1.4;
    font-family: 'Jura', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-accent);
}

.auth a {
    color: var(--auth-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth a:hover {
    color: var(--auth-gold);
    text-decoration: underline;
}

.auth .other-instructions {
    text-align: center;
    display: block;
    padding: 16px 24px;
    overflow: hidden;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--auth-text);
    opacity: 0.9;
}

/* OAuth Authentication Styles */

.auth-oauth-section {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
}

.auth-oauth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    color: rgba(89, 34, 140, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-oauth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--auth-border), transparent);
    z-index: 0;
}

.auth-oauth-divider span {
    background: var(--auth-form-bg);
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

.auth-oauth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--auth-form-bg);
    color: var(--auth-text);
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    font-family: 'Jura', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.auth-oauth-button:hover {
    background-color: rgba(89, 34, 140, 0.1);
    border-color: var(--auth-accent);
    box-shadow: 0 4px 16px rgba(89, 34, 140, 0.2);
    transform: translateY(-2px);
}

.auth-oauth-button svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.auth-oauth-button-google {
    background: linear-gradient(135deg, rgba(89, 34, 140, 0.05), rgba(89, 34, 140, 0.1));
    border: 2px solid var(--auth-accent);
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(89, 34, 140, 0.15);
}

.auth-oauth-button-google:hover {
    background: linear-gradient(135deg, rgba(89, 34, 140, 0.1), rgba(89, 34, 140, 0.15));
    border-color: var(--auth-accent-light);
    box-shadow: 0 6px 24px rgba(89, 34, 140, 0.25);
    transform: translateY(-3px);
}

.auth-oauth-button-google svg {
    width: 24px;
    height: 24px;
    margin-right: 4px;
}

.auth-oauth-button-github {
    /* GitHub-specific styling for future use */
}

.auth-error-message {
    background-color: rgba(171, 0, 0, 0.2);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(171, 0, 0, 0.4);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.auth-success-message {
    background-color: rgba(34, 139, 34, 0.2);
    color: #7dcea0;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(34, 139, 34, 0.4);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth {
        padding: 24px 16px;
    }

    .auth h1 {
        font-size: 2rem;
    }

    .auth h1::before {
        width: 140px;
        height: 140px;
    }

    .auth form {
        width: 100%;
        padding: 20px 16px;
        margin: 16px 0;
    }

    .auth-oauth-button {
        font-size: 13px;
        padding: 12px 16px;
    }

    .auth-oauth-button-google {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Focus states for accessibility */
.auth button:focus,
.auth a:focus,
.auth-oauth-button:focus {
    outline: 2px solid var(--auth-gold);
    outline-offset: 2px;
}

/* Loading state */
.auth button:disabled,
.auth-oauth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth button:disabled:hover,
.auth-oauth-button:disabled:hover {
    transform: none;
    box-shadow: none;
}
