/* Minimal Music Login Form - Complete & Self-Contained */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #191414 0%, #1DB954 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1DB954, #1ed760);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.login-header h1 {
    color: #191414;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-header p {
    color: #727272;
    font-size: 15px;
    font-weight: 400;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #191414;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    background: #f6f6f6;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    color: #191414;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    background: #ffffff;
    border-color: #1DB954;
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.form-group input::placeholder {
    color: #a7a7a7;
}

/* Password Field */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #727272;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #191414;
    font-weight: 500;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d9d9d9;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #1DB954;
    border-color: #1DB954;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.forgot-link {
    color: #1DB954;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #1ed760;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: #1DB954;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    position: relative;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    background: #1ed760;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #a7a7a7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loader-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loader-dot:nth-child(2) { animation-delay: 0.16s; }
.loader-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e1e1;
}

.divider span {
    background: #ffffff;
    color: #727272;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    width: 100%;
    background: #ffffff;
    color: #191414;
    border: 1px solid #d9d9d9;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    min-height: 44px;
}

.social-btn:hover {
    border-color: #191414;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-btn:active {
    transform: translateY(0);
}

.apple-btn {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.apple-btn:hover {
    background: #333333;
    border-color: #333333;
}

/* Signup Link */
.signup-link {
    text-align: center;
}

.signup-link p {
    color: #727272;
    font-size: 14px;
}

.signup-link a {
    color: #1DB954;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.signup-link a:hover {
    color: #1ed760;
    text-decoration: underline;
}

/* Error States */
.error-message {
    color: #e22134;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-group.error input {
    border-color: #e22134;
    background: #fef7f7;
}

.form-group.error input:focus {
    box-shadow: 0 0 0 3px rgba(226, 33, 52, 0.1);
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s ease;
}

.success-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    margin: 0 auto 16px;
    animation: successScale 0.5s ease-out;
}

@keyframes successScale {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-message h3 {
    color: #191414;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.success-message p {
    color: #727272;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 12px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
/* === Accessibility: keyboard focus indicators === */
/* Restores visible focus rings for keyboard users without affecting mouse interaction. */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion: respect user preference. Animations defined per form will tone down. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
