/* Login Modal Styles */

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modal Base */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10003;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

#loginModal .modal-overlay,
#createSignupModal .modal-overlay {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #616161;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #212121;
}

/* Login Modal Content */
.login-modal-content {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.login-modal-form {
    padding: 2rem;
}

/* Login Views */
.login-view {
    display: flex;
    flex-direction: column;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212121;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #616161;
    text-align: center;
    margin: -1rem 0 1.5rem 0;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: #616161;
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #212121;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.login-input::placeholder {
    color: #9e9e9e;
    opacity: 0.7;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #616161;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #212121;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* Forgot Password Link */
.forgot-password-link {
    font-size: 0.85rem;
    color: #616161;
    text-decoration: none;
    text-align: right;
    margin-top: -0.5rem;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #0ea5e9;
}

/* Login Error */
.login-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.25rem;
}

/* Login Primary Button */
.login-btn-primary {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: #0ea5e9;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.login-btn-primary:hover:not(:disabled) {
    background: #0284c7;
    transform: translateY(-1px);
}

.login-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-divider span {
    font-size: 0.8rem;
    color: #616161;
    text-transform: lowercase;
}

/* Social Buttons */
.login-social-buttons {
    display: flex;
    gap: 0.75rem;
}

.login-btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #424242;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.login-btn-social svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-btn-social:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.login-btn-google:hover {
    border-color: #4285F4;
}

.login-btn-patreon {
    background: #000;
    color: white;
}

.login-btn-patreon:hover {
    border-color: #ff424d;
    background: #1a1a1a;
}

/* Checkbox */
.login-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #616161;
    cursor: pointer;
}

.login-checkbox input {
    margin-top: 0.15rem;
    accent-color: #0ea5e9;
}

.login-checkbox a {
    color: #0ea5e9;
    text-decoration: none;
}

.login-checkbox a:hover {
    text-decoration: underline;
}

/* Switch Text */
.login-switch {
    text-align: center;
    font-size: 0.9rem;
    color: #616161;
    margin-top: 1.25rem;
}

.login-switch a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.login-switch a:hover {
    text-decoration: underline;
}

/* Create Signup Modal */
#createSignupModal {
    z-index: 10003;
}

#createSignupModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#createSignupModal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.create-signup-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.create-signup-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212121;
    margin-bottom: 0.5rem;
}

.create-signup-subtitle {
    color: #616161;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.create-signup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-signup-input-group {
    position: relative;
}

.create-signup-input {
    width: 100%;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #212121;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.create-signup-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.create-signup-input::placeholder {
    color: #9e9e9e;
}

.create-signup-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    min-height: 1.2rem;
    text-align: left;
}

.create-signup-btn {
    width: 100%;
    padding: 1rem;
    background: #0ea5e9;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.create-signup-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.create-signup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.create-signup-login-link {
    margin-top: 1.5rem;
    color: #616161;
    font-size: 0.9rem;
}

.create-signup-login-link a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.create-signup-login-link a:hover {
    text-decoration: underline;
}

.create-signup-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: #616161;
    font-size: 0.85rem;
}

.create-signup-divider::before,
.create-signup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.create-signup-social {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.create-signup-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #424242;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.create-signup-social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.create-signup-google {
    background: white;
    color: #333;
    border-color: #ddd;
}

.create-signup-google:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.create-signup-patreon {
    background: #000;
    color: #fff;
    border-color: #000;
}

.create-signup-patreon:hover {
    background: #222;
    border-color: #222;
}

#createSignupModal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #616161;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    padding: 0.25rem;
}

#createSignupModal .modal-close:hover {
    color: #212121;
}

/* Responsive */
@media (max-width: 480px) {
    .login-modal-content {
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }

    .login-modal-form {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-input {
        padding: 0.75rem 0.9rem 0.75rem 2.5rem;
        font-size: 0.9rem;
    }

    .login-btn-primary {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .login-btn-social {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }
}
