/* Nextcloud Login Page Styles - Authentic Design */

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

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

html,
body {
    height: 100%;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1c1c1c;
    background: #0082c9;
    background-image: linear-gradient(40deg, #0082c9 0%, #30a0e0 100%);
    overflow-x: hidden;
}

/* Background pattern */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(
            circle at 25% 25%,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 75% 75%,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: -1;
}

.wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Header with logo */
#header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.logo {
    display: inline-block;
    position: relative;
}

.logo img {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(1);
    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Login container */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 40px 50px;
    width: 100%;
    max-width: 420px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1c1c1c;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Form styles */
.login-fieldset {
    border: none;
    padding: 0;
}

.grouptop,
.groupmiddle,
.groupbottom {
    position: relative;
    margin-bottom: 0;
}

.grouptop input {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.groupmiddle input {
    border-radius: 0;
    border-bottom: none;
    border-top: none;
}

.groupbottom input[type="text"],
.groupbottom input[type="password"],
.groupbottom input[type="email"] {
    border-radius: 0 0 8px 8px;
    border-top: none;
    margin-bottom: 20px;
}

/* Input styles */
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e1e5e9;
    font-size: 16px;
    font-weight: 400;
    background: #fff;
    color: #1c1c1c;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #0082c9;
    box-shadow: 0 0 0 3px rgba(0, 130, 201, 0.1);
    background: #fff;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: #8d8d8d;
    font-weight: 400;
}

/* Submit wrapper */
.submit-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0;
    font-size: 14px;
}

.submit-wrapper label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
    font-weight: 400;
    user-select: none;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: #0082c9;
    cursor: pointer;
}

.submit-wrapper a {
    color: #0082c9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.submit-wrapper a:hover {
    color: #006ba8;
    text-decoration: underline;
}

/* Submit button */
.login.primary {
    background: linear-gradient(135deg, #0082c9 0%, #006ba8 100%);
    border: none;
    color: #fff;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 130, 201, 0.2);
    letter-spacing: 0.3px;
}

.login.primary:hover {
    background: linear-gradient(135deg, #006ba8 0%, #005a8a 100%);
    box-shadow: 0 4px 12px rgba(0, 130, 201, 0.3);
    transform: translateY(-1px);
}

.login.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 130, 201, 0.2);
}

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

/* Alternative logins */
.alternative-logins {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e5e5e5;
}

.alternative-logins p {
    margin-bottom: 15px;
    color: #8d8d8d;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.alternative-logins p::before,
.alternative-logins p::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e5e5e5;
}

.alternative-logins p::before {
    left: 0;
}

.alternative-logins p::after {
    right: 0;
}

.alternative-login .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #fff;
    width: 100%;
}

.alternative-login .button:hover {
    border-color: #0082c9;
    color: #0082c9;
    background: rgba(0, 130, 201, 0.02);
    transform: translateY(-1px);
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

footer a:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Error messages */
.error-message {
    background: #ff4757;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.loading-spinner {
    display: none;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top: 2px solid #0082c9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .wrapper {
        padding: 15px;
    }

    .login-container {
        padding: 30px 25px;
        max-width: 100%;
    }

    .login-header h2 {
        font-size: 24px;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .submit-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 320px) {
    .login-container {
        padding: 25px 20px;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="password"],
    input[type="email"] {
        border-color: #000;
    }

    input[type="text"]:focus,
    input[type="password"]:focus,
    input[type="email"]:focus {
        border-color: #0066cc;
        box-shadow: 0 0 0 2px #0066cc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
