/* ================================================
   COPELLA ACCOUNTS - LOGIN & REGISTER FORMS
   Стили в стиле Topics плагина
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@700;800;900&display=swap');

@font-face {
    font-family: 'Gilroy-SemiBold';
    src: url('https://copella.live/assets/fonts/Gilroy-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy-Bold';
    src: url('https://copella.live/assets/fonts/Gilroy-Bold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

.copella-accounts-login,
.copella-accounts-register {
    max-width: 480px;
    margin: 60px auto;
    padding: 48px 40px;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.copella-accounts-form h2 {
    margin: 0 0 32px 0;
    text-align: center;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900;
    font-family: 'Unbounded', 'Gilroy-Bold', sans-serif;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.1;
}

.copella-accounts-field {
    margin-bottom: 24px;
}

.copella-accounts-field label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Gilroy-SemiBold', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
}

.copella-accounts-field input[type="text"],
.copella-accounts-field input[type="password"],
.copella-accounts-field input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
}

.copella-accounts-field input[type="text"]:focus,
.copella-accounts-field input[type="password"]:focus,
.copella-accounts-field input[type="email"]:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.copella-accounts-field input[type="text"]::placeholder,
.copella-accounts-field input[type="password"]::placeholder,
.copella-accounts-field input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.copella-username-counter {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.copella-username-counter.warning {
    color: #ff6b35;
}

.copella-username-counter.error {
    color: #ff5252;
}

/* Hidden file input */
.copella-avatar-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Avatar upload wrapper */
.copella-avatar-upload-wrapper {
    position: relative;
    width: 100%;
}

/* Avatar upload area */
.copella-avatar-upload-area {
    width: 100%;
    min-height: 160px;
    padding: 32px 24px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.copella-avatar-upload-area:hover {
    border-color: rgba(255, 107, 53, 0.5);
    background: rgba(255, 107, 53, 0.05);
}

.copella-avatar-upload-area.drag-over {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
    transform: scale(1.02);
}

.copella-avatar-upload-area.has-image {
    border: none;
    padding: 0;
    min-height: 0;
    background: transparent;
    cursor: default;
}

.copella-avatar-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.copella-avatar-upload-icon {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.copella-avatar-upload-area:hover .copella-avatar-upload-icon {
    color: #ff6b35;
    transform: translateY(-2px);
}

.copella-avatar-upload-text {
    margin: 0;
    font-size: 15px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.copella-avatar-upload-link {
    color: #ff6b35;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.copella-avatar-upload-link:hover {
    color: #ff8555;
}

.copella-avatar-upload-hint {
    margin: 0;
    font-size: 13px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.copella-accounts-button {
    width: 100%;
    padding: 16px 24px;
    background: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Gilroy-SemiBold', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    outline: none;
}

.copella-accounts-button:hover {
    background: #ff8555;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    transform: translateY(-1px);
}

.copella-accounts-button:active {
    transform: translateY(0);
}

.copella-accounts-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.copella-accounts-message {
    margin: 20px 0;
    padding: 14px 18px;
    border-radius: 12px;
    display: none;
    font-size: 14px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-weight: 500;
    line-height: 1.5;
}

.copella-accounts-message.show {
    display: block;
}

.copella-accounts-message.success {
    background: rgba(255, 107, 53, 0.15);
    color: #ff8555;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.copella-accounts-message.error {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.copella-accounts-link {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-family: 'Gilroy-SemiBold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.6);
}

.copella-accounts-link a {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.copella-accounts-link a:hover {
    color: #ff8555;
    text-decoration: underline;
}

.copella-avatar-preview {
    margin-top: 16px;
    text-align: center;
    position: relative;
    display: inline-block;
}

.copella-avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: block;
}

.copella-avatar-preview .copella-avatar-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 82, 82, 0.9);
    border: 2px solid rgba(17, 17, 17, 0.95);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 10;
}

.copella-avatar-preview .copella-avatar-remove:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.copella-avatar-preview .copella-avatar-remove svg {
    width: 14px;
    height: 14px;
}

/* Auth Modal */
.copella-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.copella-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: none;
}

.copella-auth-modal-content {
    position: relative;
    max-width: 420px;
    width: 100%;
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.copella-auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.copella-auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.copella-auth-form-wrapper {
    width: 100%;
}

/* Mobile */
@media (max-width: 768px) {
    .copella-accounts-login,
    .copella-accounts-register {
        margin: 40px 20px;
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .copella-accounts-form h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }
    
    .copella-accounts-field {
        margin-bottom: 20px;
    }
    
    .copella-auth-modal-content {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .copella-auth-modal {
        padding: 16px;
    }
}
